IN THIS BLOG
Someone on your team has probably already been asked to put AI in your virtual labs. A customer training program, an internal Python course, or maybe a sales engineer who wants to show off the MCP server you shipped last quarter.
For some, installing it is the easy part. It’s functional, but it needs a key to run, and what or whose AI API key you will use is a bigger problem than you might think.Â
Right now, in most labs running AI or Agentic capabilities, the answer is someone’s real one. A corporate account, or a key pasted into the template that everyone shares. It works, but whether it’s safe is a different question, and so is what it costs.
With virtual labs, you build the environment and the person you’re training or selling to gets a pre-configured experience. Everything installed, prerequisites met, every version pinned, ready to go when they arrive.
Each lab is a copy, from the software and the data down to the machine itself. Copies are reliable, cost effective and controlled environments.Â
An API key isn’t a copy. It’s live access to a system or tool, sitting on a VM you’re about to hand to someone else, that spends money on your behalf.
Why are agents showing up in virtual labs?
Agents are the topic in almost every major software company right now. Organizations have spent the past year making their software operable by them. And a capability nobody can try is a capability that doesn’t sell.
Everywhere you look, AI is everywhere in modern software:Â
- In April 2026 Salesforce announced Headless 360, exposing the platform as APIs, MCP tools and CLI commands so agents can execute business processes without anyone even opening a browser.
- Two weeks earlier, Parker Harris, CTO of Slack and co-founder of Salesforce, had put it to an audience as a question: why should you ever log into Salesforce again?
- Datadog shipped Pup, an agent-first CLI for its platform. Kestra publishes agent skills so coding agents can drive its orchestration engine without a custom integration.
An analysis of the MCP registry counted close to 10,000 published servers by May 2026, and Stacklok’s 2026 software report put 41% of surveyed software organizations in limited or broad production with MCP servers.Â
If you ship software, some part of it probably calls a model already.
What do your API key options look like today?
Most teams work down the list below in order.Â
You could ask the learner to bring their own. This moves the cost and the risk off your account, and it moves the setup onto someone who’s either there to learn or buy from you, and neither are the best experience.
Share one key. The corporate account, or a key baked into the template. It’s the most reliable way to make sure a demo, a training course or an enablement session runs the moment the VM boots. It also accumulates risk and management overhead, and a runaway loop or a misconfigured rule can burn the whole budget before anyone looks.
Scope a key to the session. Which is where most teams land, and where the question becomes how you’d actually run it.

With attackers reportedly exploiting exposed cloud credentials within an average of 17 minutes, while close to a quarter of organizations take more than a day to rotate them, how you’re using AI in virtual labs is a conversation every organization should be having in 2026.Â
Why weren't AI API keys designed for this?
Your AI provider key was built for one job. Connecting an application you wrote to a model, inside the infrastructure you control. One key, one owner, running until someone remembers to rotate it.
A lab breaks every one of those assumptions. Learners, prospects, partners, or three hundred of your own engineers run the same lab this month. Each of them needs working AI access for the length of a session, on a machine you hand over and then destroy.

There is a second problem behind the credential one, too. AI spend doesn’t behave like the infrastructure spend you already control with your Virtual Lab provider.Â
What does good AI API key management look like?
Each session gets its own, minted virtual key when the lab launches, and dropped into whatever tooling is already installed. They’re scoped to a set of models and capped at a budget that fits the task. When the session ends, so does the key.

The real account key stays where it belongs. The person in the lab never sees it. And what they spend is accounted for against their session, so you can answer what a cohort or an evaluation cost without having to wait for next month’s bill.
Three questions you can ask today
- To your security team. What’s our position on AI provider credentials in customer-facing environments? Most organizations have a firm instinct and no documented policy, and the instinct rarely survives an enterprise security questionnaire.
- To whoever owns the AI budget. Can we attribute AI spend to a specific cohort, evaluation or deal today? Without attribution you can’t tell what a program costs to run twice.
- To the product team. Which of our agent surfaces are we comfortable with a customer driving unsupervised, and which aren’t ready? Right now that gets decided in a session, under time pressure, by whoever is running it.
AI API Key FAQs
How can learners be issued with AI API keys for training?
The workable pattern is one key per lab session, issued automatically when the environment launches and expiring when it ends. The key is backed by your provider account but it isn’t your provider key, so it can carry its own spend limit and model restrictions. Learners never enter or see a credential, because it’s injected into the environment as it boots and the AI tooling picks it up.
What are the risks of giving learners a shared AI API key?
- Lack of visibility on spend, because any one person can consume the entire budget and nobody knows who did until the invoice arrives.Â
- Increased security risk, because a key sitting in a template is visible to everyone who touches the lab and lives on after the session ends.Â
- Difficulty with attribution, because a single shared key produces one undifferentiated bill, so you can’t tell what a cohort cost, or which course is expensive to run. Rotating a shared key also breaks every lab using it at once.
Can I give someone AI access in a lab without giving them my company's API key?
You can run an AI gateway like LiteLLM or Portkey yourself, but they’re complex pieces of infrastructure, the key management is ongoing work, and the governance is entirely on you. Plus, they don’t have the capability that hands-on lab software like Heropa offers that’s critical to your training and demonstrations.
Do learners need their own AI provider account?
Not everyone has a personal account, and submitting model usage per lab is more overhead on you and your customer. If you’re using virtual labs to demonstrate software capability, there’s a slim chance the prospect evaluating your software will set up billing with a third party just to sit through your demo.
Who pays for the AI usage in a customer training program?
Whoever owns the AI API key. If it’s your corporate account, you’re paying for every learner’s tokens, and the spend can very quickly get out of control. That’s why this turns into a finance conversation as well as a security one.


