How an AI testing vendor should take custody of customers' test credentials
In short
Take customers' test credentials through a write-only channel, store them encrypted under a key per customer, release each only to that customer's runs that name it, keep people out by default, rotate and expire them, and destroy the customer's key when the contract ends.
Credential custody is everything a vendor does with secrets a customer hands over: how they arrive, where they are stored, who and what can use them, how long they live and how they are destroyed. When your AI agent logs into customers' apps to test them, you hold many companies' credentials at once, and each customer will ask how theirs are kept apart from everyone else's.
What credentials does an AI testing vendor end up holding?
An AI testing vendor ends up holding several kinds of secret per customer, each with its own risk.
Table: Credentials a testing vendor holds for each customer
| Credential | Example | Main risk |
|---|---|---|
| Test account passwords | A QA user in the customer's staging app | Login as that user by anyone who reads it |
| One-time password seeds | The TOTP secret behind a test account's second factor | Valid codes for as long as the seed is kept |
| API keys and tokens | A key to seed test data or reset the environment | Broad, long-lived access to the customer's systems |
| Saved sessions | Cookies or tokens captured after a login | Bypass of login and second factor until they expire |
| Access to preview environments | A basic-auth pair or allow-listed address | Exposure of unreleased features |
Each row is a secret of one customer only. Nothing in your design should let a run, a person or a log for customer A touch customer B's row.
What does per-run secret delivery look like on a hosted sandbox?
On a hosted sandbox, per-run delivery comes down to naming a stored secret on the runs that need it. Six providers document how a stored credential reaches a sandbox, each on its own pages, all read 2026-11-26.
Promigence's FAQ says a secret is stored once, encrypted at rest, given only to the commands that name it with --secret NAME, removed from logs and outputs and never written into a snapshot you build, and that a snapshot of a sandbox that was given one is refused unless you force it. A key or token that travels in a request header can stay out of the sandbox altogether: its CLI reference says that with --host HOST on secrets set, "requests sent to the address this command prints for HOST are authenticated for you", and that --no-raw means "never give the value itself to a sandbox", which its home page puts as "Bind a secret to a host with --no-raw and the sandbox never holds its value". When such a binding cannot be set up, its error reference says "Nothing ran, nothing was billed, and the value never entered the sandbox." The CLI reference also covers the intake side described in Step 1 below: promigence secrets set NAME reads the value from an environment variable, a file or stdin and refuses a value typed on the command line, and promigence secrets list shows names, with values never shown. With one secret name per customer credential, a run for one customer names only that customer's secrets. The names, host and cap below are illustrative:
promigence secrets set ACME_QA_PASSWORD --from-env ACME_QA_PASSWORD
promigence run --snapshot acme-e2e --count 4 --cap 5 \
--secret ACME_QA_PASSWORD --allow staging.acme.example \
-- sh -c "npm run e2e"
A password that the login step must type goes in with --secret, which the same reference says gives the sandbox the value as an environment variable of the same name, so for that kind of credential the rule in Step 3 below applies: read it only in the login code and keep it out of prompts and screenshots. At offboarding, promigence secrets delete NAME removes the stored value.
The other five providers document their credential handling this way:
Table: Stored credentials as documented by AWS, Daytona, E2B, Google Cloud and Modal (read 2026-11-26)
| Provider | Where the credential is kept | How code in a sandbox uses it | Source |
|---|---|---|---|
| AWS | Amazon Bedrock AgentCore Identity, an identity and credential management service for agents; data in its token vaults is encrypted at rest with AWS owned keys by default, or with customer managed keys | The service lets agents and tools access AWS resources and third-party services on behalf of users, through SigV4, OAuth 2.0 flows and API keys | AgentCore Identity, Identity overview, Identity data encryption |
| Daytona | Secrets scoped to the organization and encrypted at rest; the value is never returned by the API after creation | Named when a sandbox is created; the page says code in the sandbox can use the credential to reach an allowed host but cannot read its value | Secrets |
| E2B | Secrets stored once, belonging to a project and referenced by name; values are write-only through the management API, so responses, reads, lists and API errors never return them | The sandbox configuration holds only a reference to the secret; its environment-variable page says environment variables are not for secrets, because any code in the sandbox can read them | Secrets overview, Environment variables |
| Google Cloud (Gemini Enterprise Agent Platform sandboxes) | The guide recommends keeping authenticated calls in the parent agent: sandboxed code has no ambient credentials and does not inherit the parent agent's identity | Only credentials you provide explicitly; for direct calls the guide advises short-lived, narrowly scoped tokens for that execution rather than long-lived service account keys | Sandboxes overview |
| Modal | Secrets created in the dashboard, with the modal secret command line or from Python, and deleted with modal secret delete | Injected as environment variables; an experimental Sandbox feature lets a Sandbox call external HTTPS APIs without the key being visible inside it | Secrets, Sandbox secret injection |
Whichever store you use, the steps below decide who may put a customer's credential into it, which runs may use it, and when it is destroyed.
Step 1: How should customers hand credentials over?
Customers should hand credentials over through a write-only channel that puts them straight into your secret store.
- Offer a form or API that encrypts on arrival and returns a reference, never the value.
- Refuse credentials sent by email, chat or ticket. If one arrives, store it properly, delete the message, and ask the customer to rotate it.
- Record who submitted each credential, for which environment, with what expiry.
- Ask for test-only accounts with the least privilege the tests need, in a non-production environment.
Step 2: How should the credentials be stored?
Store them in a central secret store, encrypted under a key that belongs to that customer alone. OWASP's Secrets Management Cheat Sheet says "you must standardize and centralize the secrets management solution with care", and describes envelope encryption, where a main key protects a data key and "The data key, in turn, encrypts the secret" (OWASP Secrets Management Cheat Sheet, read 2026-11-26). For tenants, OWASP's multi-tenant sheet adds "Generate unique encryption keys per tenant where required" (OWASP Multi-Tenant Security Cheat Sheet, read 2026-11-26).
A key per customer gives you three things a shared key cannot:
- A run or service holding customer A's key cannot decrypt customer B's secrets.
- Key access logs show exactly when each customer's secrets were used.
- Destroying one key makes one customer's secrets unrecoverable, in backups too.
Step 3: Who and what may use a stored credential?
Only the run that needs a credential, for that customer, at the moment it logs in, may use it; no person may read it by default. OWASP says "engineers should not have access to all secrets in the secrets management system, and the Least Privilege principle should be applied" (OWASP Secrets Management Cheat Sheet, read 2026-11-26).
- Give each run a short-lived identity bound to its tenant and run ID.
- Let that identity fetch only the credentials named in the run's task, for its own tenant.
- Give the value only to the code that logs in, at the moment of use. OWASP notes that environment variables "are generally accessible to all processes and may be included in logs or system dumps", so if your platform delivers secrets as environment variables, read them only in the login step and never print or dump the environment.
- Keep the value out of the model's prompt, tool results, screenshots and logs.
- For support staff, use a break-glass path with approval, a time limit and an alert to the customer's security contact.
Step 4: How long should a credential live?
A credential should live only as long as the customer's testing needs it, with an expiry set on day one. OWASP's lifecycle guidance: "You should regularly rotate secrets so that any stolen credentials will only work for a short time", "You should create secrets to expire after a defined time where possible", and "Applications should verify that the secret is still active before trusting it" (OWASP Secrets Management Cheat Sheet, read 2026-11-26).
- Ask customers to rotate test passwords on a schedule they choose, and accept the new value through the same write-only channel.
- Prefer tokens that expire and can be revoked over passwords that do not.
- Treat TOTP seeds as long-lived secrets. RFC 6238 recommends "storing the keys securely in the validation system", and the same applies to a vendor generating codes (RFC 6238, read 2026-11-26).
Step 5: How do I keep credentials out of logs and recordings?
Keep them out by never writing them and by masking before anything is stored. The OWASP Logging Cheat Sheet lists "Access tokens", "Authentication passwords" and "Encryption keys and other primary secrets" among data that should not be logged directly (OWASP Logging Cheat Sheet, read 2026-11-26). If one slips through, OWASP's secrets sheet says "Secrets in logs must have a process for removing the secret while maintaining log integrity", and the customer should be told so they can rotate it.
Step 6: How do I destroy credentials when a customer leaves?
Destroy them by revoking, deleting, and then destroying the customer's encryption key. NIST SP 800-88 Rev. 2 calls the last step cryptographic erase, "A purge sanitization technique in which key sanitization is applied to one or more keys providing confidentiality protections for the encrypted target data, making recovery of the decrypted target data infeasible", and notes that for cloud storage it "may be the only viable purge sanitization technique option" (NIST SP 800-88 Rev. 2, read 2026-11-26).
- Revoke tokens and sessions that can be revoked.
- Delete the stored values and their versions.
- Destroy the customer's key, which makes backup copies unreadable.
- Send the customer a dated confirmation listing what was destroyed, so they can disable the accounts on their side.
Our article on retention and deletion for agent runs covers the rest of a customer's data.
What we read for this article
- OWASP Secrets Management Cheat Sheet, read 2026-11-26
- OWASP Multi-Tenant Application Security Cheat Sheet, read 2026-11-26
- OWASP Logging Cheat Sheet, read 2026-11-26
- RFC 6238, TOTP: Time-Based One-Time Password Algorithm, read 2026-11-26
- https://www.promigence.ai/faq (FAQ), read 2026-11-26
- https://www.promigence.ai/docs/cli (CLI reference), read 2026-11-26
- https://www.promigence.ai/ (home page), read 2026-11-26
- https://www.promigence.ai/docs/errors (error reference), read 2026-11-26
- AWS: AgentCore Identity, Identity overview and Identity data encryption, read 2026-11-26
- Daytona: Secrets, read 2026-11-26
- E2B: Secrets overview and Environment variables, read 2026-11-26
- Google Cloud: Agent Platform sandboxes overview, read 2026-11-26
- Modal: Secrets and Sandbox secret injection, read 2026-11-26
- NIST SP 800-88 Rev. 2, Guidelines for Media Sanitization, read 2026-11-26
Questions readers ask
Should customers give an AI testing vendor production credentials?
Avoid it. Ask for dedicated test accounts in a non-production environment with the least privilege the tests need, and an expiry date. If production access is unavoidable, agree the scope, the accounts and the approval steps in writing.
How should a customer send test credentials to the vendor?
Through a form or API that writes straight into the vendor's secret store and cannot read the value back. Not by email, chat or a ticket, where the secret is copied into systems with their own retention.
How do you store a one-time password seed for a test account?
As a secret, with the same protection as the password. The TOTP standard, RFC 6238, recommends storing keys securely in the validating system and keeping the key store in a secure area, and anyone holding the seed can generate valid codes.
What happens to credentials when a customer leaves?
Revoke what can be revoked, delete the stored values, and destroy that customer's encryption key so any copies in backups cannot be decrypted. Tell the customer when it is done so they can disable the accounts on their side.
Yours,
SecureAgentSandbox editors
Revised , 8 minutes to read