# SecureAgentSandbox.com > Security for AI agents that run or test other companies' software: tenant isolation, untrusted code, outbound traffic, secrets, audit logs and questionnaires. --- # How to answer a customer's security questionnaire about your AI testing agent URL: https://www.secureagentsandbox.com/letters/answer-a-security-questionnaire-about-your-ai-agent/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Answer each question with the control you run, the evidence that shows it, and the public framework item it meets, such as a SOC 2 criterion, a NIST SP 800-53 control or an OWASP entry. Describe the agent's system boundary first and claim only what you can show. A security questionnaire is a customer's list of questions about how you protect their data, sent before they sign or renew. When your product is an AI agent that logs into the customer's app to test it, the questionnaire will contain the usual SaaS questions and a second set about the agent itself: what it can reach, whose credentials it holds, what it records and what happens if a page tricks it. ## What do customers ask an AI testing vendor? Customers ask the standard security questions plus questions specific to an agent that acts inside their app. Group them before you answer, so each group gets one consistent story: Table: Question groups in a security questionnaire for an AI testing agent | Group | Typical question | Where to read more | |---|---|---| | Tenant isolation | How are our runs and data kept apart from other customers? | [Tenant isolation](https://www.secureagentsandbox.com/letters/tenant-isolation-for-multi-tenant-ai-agents/) | | Untrusted code | Can code in our app or from the model reach your systems? | [Running untrusted code](https://www.secureagentsandbox.com/letters/run-untrusted-code-in-agent-environments/) | | Network | What can the agent connect to besides our app? | [Per-tenant outbound control](https://www.secureagentsandbox.com/letters/control-outbound-traffic-per-tenant/) | | Credentials | How do you store and use the test accounts we give you? | [Custody of test credentials](https://www.secureagentsandbox.com/letters/handle-customers-test-credentials/) | | Audit | Can you show what the agent did in our app? | [Agent audit logs](https://www.secureagentsandbox.com/letters/audit-log-for-ai-agent-actions/) | | Retention and deletion | What do you keep, for how long, and how is it deleted? | [Retention and deletion](https://www.secureagentsandbox.com/letters/data-retention-and-deletion-for-agent-runs/) | | AI-specific risks | What stops our content from hijacking the agent? | [Prompt injection from the app under test](https://www.secureagentsandbox.com/letters/prompt-injection-from-the-app-under-test/) | | Third parties | Which model providers and sub-processors see our data? | GDPR Article 28 | ## Step 1: How do I describe the system before answering? Describe the system boundary first: the components, the data that flows between them and the third parties involved. Reviewers read every later answer against it. The SOC 2 criteria are written for "controls over the security, availability, processing integrity, confidentiality, or privacy of information and systems", which can be assessed across an entire entity or "within a function" ([AICPA 2017 Trust Services Criteria, March 2020 edition](https://web.archive.org/web/20210628225614/https://www.aicpa.org/content/dam/aicpa/interestareas/frc/assuranceadvisoryservices/downloadabledocuments/trust-services-criteria.pdf), read 2026-11-26), so state which function the answers cover. A useful one-paragraph description names: where tasks come from, where runs execute, which model provider receives what, where recordings and logs are stored, and which of your staff can reach each part. Our [threat model for agents that test customer apps](https://www.secureagentsandbox.com/letters/threat-model-for-ai-agents-that-test-customer-apps/) gives a ready list of components and trust boundaries. ## Step 2: How should each answer be written? Write each answer in three parts: the control, the evidence and the framework reference. 1. **Control.** What you do, in one or two plain sentences. "Each run executes in its own environment, created for the run and destroyed at its end." 2. **Evidence.** What a reviewer can check: a policy, a configuration excerpt, a test result, an audit report section, a screenshot of a setting. 3. **Reference.** The public criterion or control it meets, such as "SOC 2 CC6.1; NIST SP 800-53 SC-39". Keep the wording identical across questionnaires. A reviewer who sees two versions of the same answer will ask which one is true. ## Step 3: Which framework items should I cite? Cite the items that describe the control most closely, and do not stretch a criterion to cover something it does not mention. The SOC 2 criteria come from the AICPA's 2017 Trust Services Criteria; the NIST controls from SP 800-53 Rev. 5 ([NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). A few of the most used: - **CC6.1** "The entity implements logical access security software, infrastructure, and architectures over protected information assets to protect them from security events to meet the entity's objectives." - **CC6.6** "The entity implements logical access security measures to protect against threats from sources outside its system boundaries." - **CC6.7** "The entity restricts the transmission, movement, and removal of information to authorized internal and external users and processes". - **CC7.2** "The entity monitors system components and the operation of those components for anomalies that are indicative of malicious acts". - **C1.2** "The entity disposes of confidential information to meet the entity's objectives related to confidentiality." - **NIST SC-4** "Prevent unauthorized and unintended information transfer via shared system resources." The full mapping from each question group to SOC 2, NIST and OWASP items is on our [security questionnaire control map](https://www.secureagentsandbox.com/letters/security-questionnaire-control-map/). ## Step 4: How do I answer the AI-specific questions? Answer AI-specific questions by naming the risk with its OWASP entry and describing controls that do not depend on the model behaving well. OWASP's LLM Top 10 gives the shared vocabulary: LLM01:2025 Prompt Injection and LLM06:2025 Excessive Agency, the latter defined as "the vulnerability that enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM" ([OWASP LLM06:2025](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26). Be candid about the limits. OWASP says "it is unclear if there are fool-proof methods of prevention for prompt injection" ([OWASP LLM01:2025](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), read 2026-11-26). An answer such as "we reduce what an injected agent can do: fixed test plans, minimal tools and accounts, verdicts decided in code, per-customer network rules, approval for high-impact actions" is more credible than "our agent is immune to prompt injection". ## Step 5: What do customers ask about personal data and sub-processors? Customers ask whether you meet a processor's duties when their app holds personal data. GDPR Article 28(3) lists what the contract must require of a processor, including that it "processes the personal data only on documented instructions from the controller", "takes all measures required pursuant to Article 32", deletes or returns the data at the end of the services, and "makes available to the controller all information necessary to demonstrate compliance" ([Regulation (EU) 2016/679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679), read 2026-11-26). Article 28(2) requires the controller's authorisation before you engage another processor, which includes a model provider that receives page content. Article 33(2) adds that "The processor shall notify the controller without undue delay after becoming aware of a personal data breach." List each sub-processor with what it receives, where it processes it and whether it keeps it. ## What should I avoid in questionnaire answers? Avoid answers you cannot show. 1. Do not claim a certification or report you do not hold, or one whose scope excludes the agent. 2. Do not answer "yes" to a control that exists only for some customers or some runs; state the condition. 3. Do not describe a model's instructions as a security control. A system prompt is guidance to the model, not an enforced boundary. 4. Do not promise deletion from backups unless you can show how, for example by destroying per-customer keys. 5. Do not copy another company's answers. Reviewers notice, and the controls behind them are not yours. ## What we read for this article - [AICPA 2017 Trust Services Criteria (March 2020 edition, archived copy)](https://web.archive.org/web/20210628225614/https://www.aicpa.org/content/dam/aicpa/interestareas/frc/assuranceadvisoryservices/downloadabledocuments/trust-services-criteria.pdf) and the [current AICPA edition page](https://www.aicpa-cima.com/resources/download/2017-trust-services-criteria-with-revised-points-of-focus-2022), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26 - [OWASP LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), read 2026-11-26 - [OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26 - [Regulation (EU) 2016/679, General Data Protection Regulation](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) (Articles 28 and 33), read 2026-11-26 ## FAQ ### Is a SOC 2 report the same as answering a questionnaire? No. A SOC 2 report comes from an attestation engagement in which a practitioner evaluates your controls against the AICPA trust services criteria. A questionnaire is the customer's own list of questions. A report can answer many of them, but the AI-specific questions usually need their own answers. ### Which frameworks do customers expect an AI vendor to cite? Most often the SOC 2 trust services criteria, NIST SP 800-53 controls, the OWASP Top 10 for LLM applications for model risks, and, where personal data is processed in or for the EU, GDPR Article 28 for processor obligations. ### What do I answer if we do not have a control a question asks about? Say so, describe any compensating control, and give a date if one is planned. A plain "not yet" is worth more to a reviewer than an answer that later turns out to be wrong. ### Should questionnaire answers mention the model provider? Yes, as a third party that receives data. Say what data is sent to the model, under what terms, and whether it is kept or used for training, because customers treat that provider as a sub-processor. --- # What an audit log of an AI agent's actions should record, and how to protect it URL: https://www.secureagentsandbox.com/letters/audit-log-for-ai-agent-actions/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 For every agent step, record when it happened, which customer and run it belonged to, who started it, what the agent did to which target, and the outcome. Keep the log append-only and tamper-evident, scoped per customer, free of secrets, and kept for a stated period. An agent audit log is a record of every action an AI agent took on a customer's behalf, written so that someone who was not watching can later tell what happened, in what order, why it was allowed and what it changed. When your agent works inside customers' apps, it is the evidence you hand over after an incident and the first artifact a customer's security team asks to see. ## Why does an AI agent need an audit log of its own? An AI agent needs its own audit log because its actions are chosen at run time, not written in advance, so no other record shows what it actually did. The UK National Cyber Security Centre, writing about prompt injection, advises: "You should therefore be logging enough information to identify suspicious activity", covering inputs, outputs and tool or API use ([NCSC, Prompt injection is not SQL injection](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26). The record answers three questions a customer will ask after something goes wrong: which runs touched our app, what exactly did they do, and could anything have reached another customer. ## What fields should each audit record contain? Each audit record should contain when, where, who and what, plus the agent-specific context that makes it useful. The OWASP Logging Cheat Sheet's rule is that "The application logs must record "when, where, who and what" for each event" ([OWASP Logging Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html), read 2026-11-26). NIST SP 800-53 control AU-3 lists the same content: "What type of event occurred", "When the event occurred", "Where the event occurred", "Source of the event", "Outcome of the event", and the "Identity of any individuals, subjects, or objects/entities associated with the event" ([NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). Table: Fields for an AI agent audit record | Field | Example | Why it matters | |---|---|---| | Event time and log time | `2026-11-26T09:14:03.218Z` | Order of events; OWASP notes the two can differ | | Tenant ID (server-verified) | `acme` | Scopes the record and its readers | | Run ID and step number | `run-7f3c`, `step 42` | Ties actions into one sequence | | Initiator | API key ID, user ID or schedule | Who asked for the run | | Agent version | Image digest, prompt version, model name and version | Lets you reproduce the behaviour | | Action type | `navigate`, `click`, `type`, `upload`, `request`, `tool_call` | What kind of action it was | | Target | URL, element selector, tool name | Where the action landed | | Input reference | Hash or stored copy of the prompt and page text | What the agent was reacting to | | Decision | `allowed`, `blocked_by_policy`, `needs_approval` | Which guardrail applied | | Approver | Person who approved a high-impact action | Accountability for exceptions | | Outcome | HTTP status, assertion result, error | What happened next | | Secret use | Credential reference, never its value | Shows which secret was used | ## What does one record look like? One record is a single structured line. This example is illustrative; the field names are yours to choose: ```json {"event_time":"2026-11-26T09:14:03.218Z","log_time":"2026-11-26T09:14:03.240Z","tenant":"acme","run":"run-7f3c","step":42,"initiator":{"type":"api_key","id":"key_19"},"agent":{"image":"sha256:","prompt_version":"checkout-v12","model":""},"action":"type","target":{"url":"https://staging.acme.example/login","selector":"#password"},"input_ref":"sha256:","secret_ref":"cred/acme/staging-qa-user","decision":"allowed","outcome":{"status":"ok"},"prev_hash":"sha256:"} ``` Note what is absent: the password itself. The OWASP Logging Cheat Sheet lists "Authentication passwords", "Access tokens" and "Encryption keys and other primary secrets" among data to remove, mask, hash or encrypt rather than log directly. ## How do I keep the audit log from being altered? Keep it from being altered by making the store append-only and making changes detectable. OWASP's multi-tenant sheet says to "Enforce append-only audit behavior through database permissions or storage controls such as write-once, read-many (WORM)" and to "Use tamper-evident mechanisms to detect modifications to stored audit records", noting that "tamper detection identifies modifications rather than preventing them" ([OWASP Multi-Tenant Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26). 1. Write records to a store the agent runs and the application cannot update or delete. 2. Chain records: each one carries a hash of the previous record of the same run (the `prev_hash` field above), so a removed or edited record breaks the chain. This is one way to be tamper-evident; signed batches are another. 3. Copy records to read-only storage quickly. OWASP's logging sheet says to "Store or copy log data to read-only media as soon as possible". 4. Alert on deletion attempts. NIST AU-9 asks you to "Protect audit information and audit logging tools from unauthorized access, modification, and deletion" and to alert on detection. ## Who may read the audit log? Each customer may read the records of their own tenant; your staff may read across tenants only through an explicit, logged platform role. OWASP: "A centralized audit store is acceptable when read access enforces tenant scope", "Cross-tenant audit reads and writes require explicit platform authorization", and "Tenant administrator rights must not grant platform-wide audit access" (OWASP Multi-Tenant Security Cheat Sheet, read 2026-11-26). Log the reads too: the logging sheet asks that access to logs be recorded and monitored. ## How long should the records be kept? Keep the records for a defined period, then dispose of them. NIST AU-11 asks organizations to "Retain audit records for" a period they define "to provide support for after-the-fact investigations of incidents and to meet regulatory and organizational information retention requirements" (NIST SP 800-53 Rev. 5, read 2026-11-26). The OWASP logging sheet adds that logs must not be destroyed before the required period, nor kept beyond it. Write the period into your contracts; our guide to [retention and deletion for agent runs](https://www.secureagentsandbox.com/letters/data-retention-and-deletion-for-agent-runs/) shows how to set one for each kind of data. ## What should I alert on? Alert on patterns that suggest an injected or misbehaving agent, or an isolation failure: 1. Any denied cross-tenant read or write. OWASP asks you to "Monitor denied or unexpected cross-tenant access attempts". 2. A run with many policy blocks in a row, such as refused hosts or refused tools. 3. A secret used by a run whose task did not name it. 4. A high-impact action without an approver. 5. A gap or a broken chain in a run's records. ## What we read for this article - [OWASP Logging Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html), read 2026-11-26 - [OWASP Multi-Tenant Application Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final) (controls AU-3, AU-9 and AU-11), read 2026-11-26 - [NCSC: Prompt injection is not SQL injection (it may be worse)](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26 ## FAQ ### What is the difference between an audit log and a debug log? An audit log is a record of who did what, kept to support investigations and accountability, with protected integrity and a fixed retention period. A debug log helps engineers fix faults and is usually short-lived and noisy. Keep them separate so the audit trail is complete and the debug log can be trimmed. ### Should the audit log include the full prompts and model outputs? Record enough to reconstruct what the agent saw and did, such as a hash or a stored copy of each prompt and output under the same access rules as the run's other data. Full text in the audit log itself makes it large and may copy customer data or secrets into a store with a longer life. ### Can customers see the agent's audit log? They should be able to see and export the records of their own runs. OWASP's multi-tenant guidance adds that tenant administrator rights must not grant platform-wide audit access, so the export must be scoped to the tenant. ### How long should agent audit logs be kept? For a period you state and can defend, set by your contracts and the regulations that apply. NIST control AU-11 asks organizations to define the period, and OWASP warns against both destroying logs early and keeping them beyond the period. --- # How to control outbound network traffic per customer on a multi-tenant agent platform URL: https://www.secureagentsandbox.com/letters/control-outbound-traffic-per-tenant/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Deny all outbound traffic from each agent run by default, then allow only DNS and an egress path limited to the hosts that customer asked you to test. Check resolved addresses, block internal and metadata ranges, keep runs apart, and log every connection with its tenant. Per-tenant egress control is a rule set that limits each customer's agent runs to the hosts that customer asked you to test, and nothing else. It protects three parties at once: the customer, whose data should not leave for anywhere unexpected; other customers, whose runs should be unreachable; and you, because a run that can be steered by page content must not reach your internal services. ## Why does a multi-tenant agent platform need per-tenant egress rules? A multi-tenant agent platform needs per-tenant egress rules because, by default, nothing stops a run from connecting anywhere, including to other customers' runs. The Kubernetes documentation states the defaults plainly: "By default, all pods in a Kubernetes cluster are allowed to communicate with each other, and all network traffic is unencrypted", and "By default, a pod is non-isolated for egress; all outbound connections are allowed" ([Kubernetes multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/) and [Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/), read 2026-11-26). NIST SP 800-53 describes the target state in control SC-7(5): "Deny network communications traffic by default and allow network communications traffic by exception" ([NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). ## What does per-tenant egress look like on a hosted sandbox? On a hosted sandbox, per-tenant egress becomes a setting on each run rather than a policy you maintain yourself. Six providers document such settings on their own pages, all read 2026-11-26. Promigence's FAQ says each of its sandboxes can have full outbound access, none, or an outbound allow-list of the destinations it needs, and that refused connections are recorded. Its CLI reference gives the switches: `--network none` for no network, and `--allow HOST`, repeatable, to "Let the sandboxes reach only these hosts"; a run that sets neither gets the default, `egress`, outbound access allowed. A run for one customer then carries that customer's approved hosts, built as in Step 3 below. The snapshot name, hosts, count and cap below are illustrative: ```bash promigence run --snapshot acme-e2e --count 8 --cap 5 \ --allow staging.acme.example --allow assets.acme.example \ -- sh -c "npm run e2e" ``` For the records described in Step 5, `promigence sandbox network ` shows what a sandbox may reach and, when it has an allow-list, the hosts it was refused. The error reference adds that when a requested allow-list could not be applied, the sandbox was discarded rather than started without the restriction. The other five providers document these defaults and settings for their sandboxes: Table: Outbound network settings documented by AWS, Daytona, E2B, Google Cloud and Modal (read 2026-11-26) | Provider | Outbound access by default | Settings that restrict it | Source | |---|---|---|---| | AWS (Amazon Bedrock AgentCore Code Interpreter and Browser) | Chosen when the tool is created: the console's "Sandbox" setting is an "Environment with limited external network access" and "Public network" "Allows access to public internet resources" | Network mode `PUBLIC`, `SANDBOX` or `VPC` for Code Interpreter, and `PUBLIC` or `VPC` for Browser; `VPC` needs a VPC configuration | [Create a Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-create.html), [CodeInterpreterNetworkConfiguration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CodeInterpreterNetworkConfiguration.html), [BrowserNetworkConfiguration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_BrowserNetworkConfiguration.html) | | Daytona | "Open on Tier 3 and above; restricted on Tier 1 and 2" | One of `networkBlockAll`, `networkAllowList` (up to 10 IPv4 CIDR blocks) or `domainAllowList` (up to 100 domains, wildcards allowed); on Tier 3 and 4 it can be changed on a running sandbox | [Network limits](https://www.daytona.io/docs/en/network-limits), [Isolation](https://www.daytona.io/docs/en/isolation) | | E2B | "Every sandbox has outbound access to the internet by default" | `allowInternetAccess: false`, or `network.allowOut` and `network.denyOut` lists of IP addresses, CIDR blocks and domains; domain rules cover HTTP on port 80 and TLS on port 443, and all other traffic must then be denied | [Internet access](https://e2b.dev/docs/sandbox/internet-access) | | Google Cloud (Gemini Enterprise Agent Platform sandboxes) | Code execution sandboxes run without outbound internet or VPC network access; template-backed sandboxes start with outbound internet off | `internet_access: True` opens outbound access to public IP addresses; there is no built-in domain allow-list property, so domain rules are enforced in your own VPC (Cloud NGFW or Secure Web Proxy) after a network attachment | [Sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox) | | Modal | Outbound connections to any public IP address, and no incoming connections | `block_network=True`, `outbound_cidr_allowlist`, or `outbound_domain_allowlist` (Beta, TLS on port 443); with a domain allow-list, other connections are blocked and logged to the Sandbox's system output | [Networking and security](https://modal.com/docs/guide/sandbox-networking) | Whichever provider runs the sandboxes, the customer's approved hosts still come from the process in Step 3, and the tests at the end of this article apply unchanged. ## What should the egress design look like if you build it yourself? If you build it yourself, the design has three layers, each enforced outside the agent's reach. Table: The three layers of per-tenant egress control | Layer | Enforced by | What it decides | |---|---|---| | Run network | NetworkPolicy, or a per-run container network | A run may reach DNS and the egress proxy, and nothing else | | Egress proxy | A forward proxy with a per-tenant allow-list | Which hostnames this tenant's runs may reach | | Address check | The same proxy, after DNS resolution | Whether the resolved address is public and permitted | NetworkPolicy alone cannot do the second layer. The Kubernetes page lists "Targeting of services by name" among the things the API cannot do; policies control traffic "at the IP address or port level (OSI layer 3 or 4)" (Kubernetes Network Policies, read 2026-11-26). A hostname can resolve to different addresses from one day to the next, so hostnames are checked by a proxy. ## Step 1: How do I deny everything by default? Deny everything by default with a NetworkPolicy that selects every pod in the tenant's namespace and allows no egress. This is the policy from the Kubernetes documentation: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: default-deny-egress namespace: tenant-acme spec: podSelector: {} policyTypes: - Egress ``` Two cautions from the same page. "Creating a NetworkPolicy resource without a controller that implements it will have no effect", so confirm your network plugin enforces policies. And "A default deny-all egress policy also blocks DNS traffic", so allow DNS explicitly in the next step. ## Step 2: How do I allow only DNS and the egress proxy? Allow two destinations: the cluster DNS service and the tenant's egress proxy. Every Kubernetes namespace carries the label `kubernetes.io/metadata.name`, set by the API server to the namespace's name, which "is useful if you want to target a specific namespace with a label selector" ([Kubernetes well-known labels](https://kubernetes.io/docs/reference/labels-annotations-taints/), read 2026-11-26). Check your cluster's DNS pod labels before copying the second selector. ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-dns-and-proxy namespace: tenant-acme spec: podSelector: matchLabels: role: agent-run policyTypes: - Egress egress: - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system podSelector: matchLabels: k8s-app: kube-dns ports: - protocol: UDP port: 53 - protocol: TCP port: 53 - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: egress-proxy podSelector: matchLabels: tenant: acme ports: - protocol: TCP port: 3128 ``` The proxy port is an example. The policy lets runs reach only the proxy instance serving their own tenant, so one customer's runs never share a proxy configuration with another's. Do not use an empty `namespaceSelector: {}` in these rules; the multi-tenancy page recommends against it when allowing traffic between namespaces. ## Step 3: How do I build each customer's allow-list? Build each allow-list from what the customer declares, not from what the agent asks for. 1. Ask the customer for the hostnames of the environments to test, such as their staging and preview hosts. 2. Run a supervised test session and record every hostname those pages load: scripts, fonts, APIs, identity providers. 3. Show the customer the combined list and get their approval. Record who approved it and when. 4. Store it as configuration of that tenant only. Changes need an authenticated request and leave an audit record, as described in our guide to [audit logs for agent actions](https://www.secureagentsandbox.com/letters/audit-log-for-ai-agent-actions/). 5. Refuse wildcards that cover a whole public suffix or a shared hosting domain, since other parties' sites live there too. ## Step 4: How do I stop the proxy being used to reach internal systems? Stop it by checking the address each hostname resolves to and connecting only to that checked address. OWASP's SSRF cheat sheet is the reference here ([OWASP SSRF Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html), read 2026-11-26): - "Domain allowlisting alone does not prevent DNS rebinding." "Validate the resolved destination IP addresses against the application's permitted networks", then connect to the validated address rather than resolving again. - Refuse private, loopback, link-local and unique-local ranges, and your own service addresses, whatever hostname points at them. - Block the metadata endpoints, because "In cloud environments SSRF is often used to access and steal credentials and access tokens from metadata services." - Do not follow redirects to a host that is not on the list; the sheet advises to "Disable the support for the following of the redirection in your web client". ## Step 5: How do I record what left each run? Record every connection attempt at the proxy, with the tenant, the run, the hostname, the resolved address, the decision and the bytes sent. The Kubernetes documentation lists "The ability to log network security events (for example connections that are blocked or accepted)" among things NetworkPolicy does not do, so the proxy is where this evidence lives (Kubernetes Network Policies, read 2026-11-26). Alert on a run that hits many refused hosts, which is a common sign of injected instructions, and on any refused attempt at an internal or metadata address. A customer's security team will ask for exactly these records. ## How do I test per-tenant egress? Test it from inside a real run for each of two tenants: 1. A host on tenant A's list loads in A's run and fails in B's run. 2. A host on no list fails at the proxy, and the refusal is logged with the run ID. 3. A hostname that resolves to a private address fails, even if it is on the list. 4. A direct connection that bypasses the proxy fails at the network layer. 5. A connection to another run's address fails. 6. The metadata address fails by IP and by any hostname pointing at it. ## What we read for this article - [Kubernetes: Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/), read 2026-11-26 - [Kubernetes: Multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/), read 2026-11-26 - [Kubernetes: Well-Known Labels, Annotations and Taints](https://kubernetes.io/docs/reference/labels-annotations-taints/), read 2026-11-26 - [OWASP Server-Side Request Forgery Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html), read 2026-11-26 - [https://www.promigence.ai/faq](https://www.promigence.ai/faq) (FAQ), read 2026-11-26 - [https://www.promigence.ai/docs/cli](https://www.promigence.ai/docs/cli) (CLI reference), read 2026-11-26 - [https://www.promigence.ai/docs/errors](https://www.promigence.ai/docs/errors) (error reference), read 2026-11-26 - [AWS: Create a Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-create.html), [CodeInterpreterNetworkConfiguration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CodeInterpreterNetworkConfiguration.html) and [BrowserNetworkConfiguration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_BrowserNetworkConfiguration.html), read 2026-11-26 - [Daytona: Network limits](https://www.daytona.io/docs/en/network-limits) and [Isolation](https://www.daytona.io/docs/en/isolation), read 2026-11-26 - [E2B: Internet access](https://e2b.dev/docs/sandbox/internet-access), read 2026-11-26 - [Google Cloud: Agent Platform sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox), read 2026-11-26 - [Modal: Networking and security](https://modal.com/docs/guide/sandbox-networking), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final) (control SC-7(5)), read 2026-11-26 ## FAQ ### Who decides which hosts a customer's agent runs may reach? The customer, in writing. Ask for the exact hostnames of the environments to test and of the services those pages load, store them as that tenant's allow-list, and change them only through an authenticated, logged request. ### Does a Kubernetes NetworkPolicy filter by domain name? No. The Kubernetes documentation says targeting services by name is not supported, and policies work at the IP address or port level. Filter hostnames at an egress proxy and use NetworkPolicy to force every run through that proxy. ### Why block the cloud metadata address? Because, as OWASP's SSRF guidance notes, attackers use it to steal credentials and access tokens in cloud environments. An agent that can be steered by page content must not be able to ask your infrastructure for its own credentials. ### Can Kubernetes NetworkPolicy log blocked connections? Not by itself. The documentation lists logging of blocked or accepted connections among the things the NetworkPolicy API does not do. Log at the egress proxy, where every allowed and refused request carries the run and tenant. --- # How long to keep AI agent run data, and how to delete a customer's data for good URL: https://www.secureagentsandbox.com/letters/data-retention-and-deletion-for-agent-runs/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 List every artifact an agent run creates, give each one a retention period the customer can see, delete on schedule by exact tenant scope including versions, replicas and backups, and make the deletion provable by encrypting each customer's data under its own key and destroying that key at the end. A data retention policy for agent runs states, for every kind of data a run creates, how long it is kept, why, and how it is destroyed. A vendor whose AI agent works inside customers' apps creates more of this data than most SaaS products, because every run can record screens, pages and traffic that belong to the customer and to the customer's own users. ## What data does an agent run create? An agent run creates a stack of artifacts, most of which contain the customer's data. Start by listing them, because a retention period can only be applied to data you know exists. Table: Artifacts of an AI agent run and what they can contain | Artifact | What it can contain | Who usually needs it | |---|---|---| | Screenshots and video | Everything on screen, including other users' records in the app | The customer, to see a failure | | Page snapshots and traces | Page content, form values, request and response headers | Engineers, to debug a run | | Network logs | URLs, headers, cookies, response bodies | Engineers and security | | Prompts and model outputs | Page text sent to the model and the model's reasoning | Engineers, for quality | | Test results and reports | Pass or fail, steps, extracts of the page | The customer | | Audit records | Who did what and when, without secrets | Security, for investigations | | Files downloaded or uploaded | Exports, invoices, attachments from the app | Usually nobody after the run | | Credentials and sessions | Passwords, tokens, cookies | The next run only | | Derived data | Embeddings, labelled examples, fine-tuning sets | Product teams, if the contract allows | ## Which rules apply to keeping and deleting run data? Three public frameworks set the expectations most customers will quote back to you. 1. **SOC 2 confidentiality criteria.** The Trust Services Criteria include C1.1, "The entity identifies and maintains confidential information to meet the entity's objectives related to confidentiality", with a point of focus to "determine the period over which the confidential information is to be retained", and C1.2, "The entity disposes of confidential information to meet the entity's objectives related to confidentiality" ([AICPA 2017 Trust Services Criteria, March 2020 edition](https://web.archive.org/web/20210628225614/https://www.aicpa.org/content/dam/aicpa/interestareas/frc/assuranceadvisoryservices/downloadabledocuments/trust-services-criteria.pdf), read 2026-11-26). 2. **GDPR, where the run touches personal data.** Article 5(1)(e) requires personal data be "kept in a form which permits identification of data subjects for no longer than is necessary", and Article 28(3)(g) requires a processor, "at the choice of the controller", to delete or return "all the personal data to the controller after the end of the provision of services relating to processing", and to delete "existing copies unless Union or Member State law requires storage" ([Regulation (EU) 2016/679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679), read 2026-11-26). 3. **NIST SP 800-53.** SI-12 asks you to "Manage and retain information within the system and information output from the system in accordance with applicable laws" and related requirements, and MP-6 to sanitize media before disposal or reuse ([NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). ## What do retention defaults look like on a hosted sandbox? On a hosted sandbox, part of your retention schedule is set by the provider's defaults, so read them and copy them into your own schedule. Six providers publish such defaults on their own pages, all read 2026-11-26. Promigence's security page says that whatever a run changes is discarded unless you keep it, that you can delete a snapshot whenever you like, and that it does not train on your code, your agent's outputs or your test results; its home page says of customer code, "Encrypted at rest and never trained on." The same security page states one default in days: a failed sandbox's state is kept for up to 7 days, so it can be reopened, or deleted sooner. Its limits page adds that a paused sandbox which reaches 30 days without being resumed is deleted with its files, and that an email goes to the organization's owner 7 days and 1 day before. The security page also notes that a Data Processing Addendum is available on request for workloads that handle personal data. The other five providers publish these defaults: Table: Retention defaults published by AWS, Daytona, E2B, Google Cloud and Modal (read 2026-11-26) | Provider | A sandbox's state by default | Snapshots, paused sandboxes and logs | Data terms | Source | |---|---|---|---|---| | AWS (Amazon Bedrock AgentCore) | A Runtime session's memory and disk last only as long as its compute, which is terminated with its memory sanitized when the session completes; Browser sessions are temporary and reset after each use | Browser session recordings are stored in your own Amazon S3 bucket | The AWS GDPR Data Processing Addendum, whose UK and Swiss addenda are part of the AWS Service Terms and apply automatically | [Runtime sessions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html), [Browser](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-tool.html), [GDPR Center](https://aws.amazon.com/compliance/gdpr-center/) | | Daytona | Stops after 15 minutes of inactivity; a stopped container sandbox is archived after 7 days and is not deleted automatically unless you set an auto-delete interval; ephemeral sandboxes are deleted when they stop | Snapshots become inactive after 2 weeks without use, and a deleted snapshot cannot be recovered | A Data Processing Agreement that takes effect when the customer accepts Daytona's Terms of Service | [Sandboxes](https://www.daytona.io/docs/en/sandboxes), [Snapshots](https://www.daytona.io/docs/en/snapshots), [DPA](https://www.daytona.io/dpa) | | E2B | Killed when its timeout (5 minutes by default) expires, and its state is gone unless you set it to pause instead | Paused sandboxes have no time-to-live and are removed only when you kill them; sandbox logs are kept for 7 days | A Data Processing Addendum for GDPR, as a template from its Trust Center or a signed copy by email | [Sandbox lifetime](https://e2b.dev/docs/faq/sandbox-lifetime), [Internet access](https://e2b.dev/docs/sandbox/internet-access), [Security](https://e2b.dev/security) | | Google Cloud (Gemini Enterprise Agent Platform sandboxes) | Kept for its TTL, from 7 days for a custom container to 14 days for code execution, and billed while it exists; a `ttl` set at creation removes it automatically | Snapshots are retained for their `ttl` and can be deleted sooner | Google states it will not use your data to train or fine-tune AI/ML models without your prior permission or instruction, and refers to its Cloud Data Processing Addendum | [Sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox), [Manage sandboxes](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox/manage-sandboxes), [Manage snapshots](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox/manage-snapshots), [Zero data retention](https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources/zero-data-retention) | | Modal | A Sandbox has a default maximum lifetime of 5 minutes, up to 24 hours with a timeout | Sandbox memory snapshots are kept 7 days and filesystem snapshots 30 days by default (configurable); container logs are kept 1 day on Starter and 30 days on Team; stored data is encrypted at rest | A Data Processing Addendum incorporated by reference into its customer agreement | [Sandboxes](https://modal.com/docs/guide/sandboxes), [Security and privacy](https://modal.com/docs/guide/security), [DPA](https://modal.com/legal/dpa) | For a testing vendor, each of these defaults becomes a row in the schedule built in Step 1 below. ## Step 1: How do I set a retention period for each artifact? Set a period per artifact from who needs it and for how long, write it down, and show it to customers. The schedule below is an example of the shape, not a recommendation; your contracts and the law decide the numbers. Table: An example retention schedule for agent run data (illustrative values) | Artifact | Example period | Then | |---|---|---| | Downloaded and uploaded files | End of run | Deleted with the run environment | | Credentials and sessions in the run | End of run | Deleted; the stored credential stays until rotated | | Screenshots, video, traces | 30 days, or as the customer sets | Deleted | | Network logs | 14 days | Deleted | | Prompts and model outputs | 30 days | Deleted, or kept longer only with consent | | Test results and reports | Life of the contract | Deleted at offboarding | | Audit records | A fixed period stated in the contract | Deleted at the end of the period | Let customers shorten periods for their tenant, and let them turn off recordings they do not need. Data you never store needs no deletion. ## Step 2: How do I delete one customer's data without touching another's? Delete by an exact, authorized tenant scope, and include every copy. OWASP's multi-tenant sheet says "Ensure tenant deletion targets only that tenant's objects", using an exact prefix such as `tenants/acme/` "rather than `tenants/acme`", which "could also match `tenants/acme-west/`", and to "Account for object versions, replicas, and backups when applying retention and deletion policies" ([OWASP Multi-Tenant Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26). 1. Run deletion jobs with a tenant ID taken from your own records, never from a request body. 2. Delete from every store: objects, databases, search indexes, caches, analytics copies and log stores. 3. Delete old object versions, not only the current one. 4. Record each deletion as an audit event with counts per store. ## Step 3: How do I make deletion provable, including backups? Make it provable by encrypting each customer's data under its own key and destroying that key when the data must go. NIST SP 800-88 Rev. 2 defines cryptographic erase as "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". For storage you cannot reach physically it is often the only option: "For an ISM that takes the form of logical/virtual storage (e.g., cloud storage), cryptographic erase may be the only viable purge sanitization technique option" ([NIST SP 800-88 Rev. 2](https://csrc.nist.gov/pubs/sp/800/88/r2/final), read 2026-11-26). The method only works if every copy, including backups and logs, was encrypted under that customer's key and no plaintext copy exists elsewhere. Test it: OWASP suggests you "Test a backup with two tenants: recover one tenant, verify the other tenant's records and objects are absent" (OWASP Multi-Tenant Security Cheat Sheet). ## What should happen when a customer leaves? When a customer leaves, run one documented offboarding procedure and send them its result. 1. Export what the contract says they may take, such as reports and audit records, in a standard format. 2. Revoke and delete their credentials, as in our guide to [handling customers' test credentials](https://www.secureagentsandbox.com/letters/handle-customers-test-credentials/). 3. Delete every artifact by tenant scope. 4. Destroy the tenant's keys once the backup retention window allows. 5. Send a dated confirmation listing the stores cleared and the date the keys were destroyed. ## What we read for this article - [AICPA 2017 Trust Services Criteria (March 2020 edition, archived copy)](https://web.archive.org/web/20210628225614/https://www.aicpa.org/content/dam/aicpa/interestareas/frc/assuranceadvisoryservices/downloadabledocuments/trust-services-criteria.pdf) and the [current AICPA edition page](https://www.aicpa-cima.com/resources/download/2017-trust-services-criteria-with-revised-points-of-focus-2022), read 2026-11-26 - [Regulation (EU) 2016/679, General Data Protection Regulation](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) (Articles 5 and 28), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final) (controls SI-12 and MP-6), read 2026-11-26 - [NIST SP 800-88 Rev. 2, Guidelines for Media Sanitization](https://csrc.nist.gov/pubs/sp/800/88/r2/final), read 2026-11-26 - [OWASP Multi-Tenant Application Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26 - [https://www.promigence.ai/security](https://www.promigence.ai/security) (Security and data handling), read 2026-11-26 - [https://www.promigence.ai/](https://www.promigence.ai/) (home page), read 2026-11-26 - [https://www.promigence.ai/docs/limits](https://www.promigence.ai/docs/limits) (Limits), read 2026-11-26 - [AWS: AgentCore Runtime sessions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html), [AgentCore Browser](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-tool.html) and [GDPR Center](https://aws.amazon.com/compliance/gdpr-center/), read 2026-11-26 - [Daytona: Sandboxes](https://www.daytona.io/docs/en/sandboxes), [Snapshots](https://www.daytona.io/docs/en/snapshots) and [Data Processing Agreement](https://www.daytona.io/dpa), read 2026-11-26 - [E2B: How long does a sandbox live?](https://e2b.dev/docs/faq/sandbox-lifetime), [Internet access](https://e2b.dev/docs/sandbox/internet-access) and [Security](https://e2b.dev/security), read 2026-11-26 - [Google Cloud: Agent Platform sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox), [Manage sandboxes](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox/manage-sandboxes), [Manage snapshots](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox/manage-snapshots) and [Zero data retention](https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources/zero-data-retention), read 2026-11-26 - [Modal: Sandboxes](https://modal.com/docs/guide/sandboxes), [Security and privacy](https://modal.com/docs/guide/security) and [Data Processing Addendum](https://modal.com/legal/dpa), read 2026-11-26 ## FAQ ### What data does an AI testing agent create during a run? Screenshots, video, page snapshots and traces, network logs, prompts and model outputs, test results, audit records, and sometimes copies of credentials or files from the app. Each can contain the customer's data or their users' personal data. ### Does GDPR require a vendor to delete data at the end of a contract? Where the vendor processes personal data as a processor, Article 28(3)(g) requires the contract to say the processor deletes or returns all the personal data at the controller's choice after the services end, and deletes existing copies unless EU or member state law requires storage. ### How do you delete data from backups? Either wait for backups to expire on a stated schedule and say so, or encrypt each customer's data with its own key and destroy the key. NIST SP 800-88 Rev. 2 calls the second method cryptographic erase. ### Can a vendor keep run data to improve its agent? Only if the contract allows it. Data kept for product improvement is still the customer's data, has its own retention period, and must be deleted with everything else when the customer leaves unless agreed otherwise. --- # How an AI testing vendor should take custody of customers' test credentials URL: https://www.secureagentsandbox.com/letters/handle-customers-test-credentials/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 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: ```bash 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](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html), [Identity overview](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-overview.html), [Identity data encryption](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-data-encryption.html) | | 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](https://www.daytona.io/docs/en/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](https://e2b.dev/docs/secrets), [Environment variables](https://e2b.dev/docs/sandbox/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](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox) | | 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](https://modal.com/docs/guide/secrets), [Sandbox secret injection](https://modal.com/docs/guide/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. 1. Offer a form or API that encrypts on arrival and returns a reference, never the value. 2. Refuse credentials sent by email, chat or ticket. If one arrives, store it properly, delete the message, and ask the customer to rotate it. 3. Record who submitted each credential, for which environment, with what expiry. 4. 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](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html), 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](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), 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). 1. Give each run a short-lived identity bound to its tenant and run ID. 2. Let that identity fetch only the credentials named in the run's task, for its own tenant. 3. 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. 4. Keep the value out of the model's prompt, tool results, screenshots and logs. 5. 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](https://www.rfc-editor.org/rfc/rfc6238), 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](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html), 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](https://csrc.nist.gov/pubs/sp/800/88/r2/final), read 2026-11-26). 1. Revoke tokens and sessions that can be revoked. 2. Delete the stored values and their versions. 3. Destroy the customer's key, which makes backup copies unreadable. 4. 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](https://www.secureagentsandbox.com/letters/data-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](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html), read 2026-11-26 - [OWASP Multi-Tenant Application Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26 - [OWASP Logging Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html), read 2026-11-26 - [RFC 6238, TOTP: Time-Based One-Time Password Algorithm](https://www.rfc-editor.org/rfc/rfc6238), read 2026-11-26 - [https://www.promigence.ai/faq](https://www.promigence.ai/faq) (FAQ), read 2026-11-26 - [https://www.promigence.ai/docs/cli](https://www.promigence.ai/docs/cli) (CLI reference), read 2026-11-26 - [https://www.promigence.ai/](https://www.promigence.ai/) (home page), read 2026-11-26 - [https://www.promigence.ai/docs/errors](https://www.promigence.ai/docs/errors) (error reference), read 2026-11-26 - [AWS: AgentCore Identity](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html), [Identity overview](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-overview.html) and [Identity data encryption](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-data-encryption.html), read 2026-11-26 - [Daytona: Secrets](https://www.daytona.io/docs/en/secrets), read 2026-11-26 - [E2B: Secrets overview](https://e2b.dev/docs/secrets) and [Environment variables](https://e2b.dev/docs/sandbox/environment-variables), read 2026-11-26 - [Google Cloud: Agent Platform sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox), read 2026-11-26 - [Modal: Secrets](https://modal.com/docs/guide/secrets) and [Sandbox secret injection](https://modal.com/docs/guide/sandbox-secret-injection), read 2026-11-26 - [NIST SP 800-88 Rev. 2, Guidelines for Media Sanitization](https://csrc.nist.gov/pubs/sp/800/88/r2/final), read 2026-11-26 ## FAQ ### 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. --- # How to defend an AI testing agent against prompt injection from the app it tests URL: https://www.secureagentsandbox.com/letters/prompt-injection-from-the-app-under-test/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Treat every page of the app under test as untrusted input that may carry instructions. Fix the test plan before the agent reads the app, give it only the tools and accounts the test needs, decide pass or fail in code, and contain each run so a hijacked agent reaches only that customer's app. Prompt injection from the app under test happens when text inside the application your agent is testing is read by the model as an instruction. For a vendor whose agent tests customers' web apps, it is the threat that matters most, because the agent must read the app to test it and cannot know in advance which text is hostile. ## Why is the app under test untrusted input? The app under test is untrusted input because many parties can put text in it and the model cannot reliably tell their text from your instructions. Greshake and co-authors, who named indirect prompt injection, put it this way: "We argue that LLM-Integrated Applications blur the line between data and instructions" ([Greshake et al., arXiv 2302.12173](https://arxiv.org/abs/2302.12173), read 2026-11-26). The UK NCSC states the cause: "Current large language models (LLMs) simply do not enforce a security boundary between instructions and data inside a prompt" ([NCSC](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26). The text need not be visible. OWASP's LLM01:2025 says "prompt injections do not need to be human-visible/readable, as long as the content is parsed by the model" ([OWASP LLM01:2025](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), read 2026-11-26). ## Who can inject instructions into a customer's app? More parties than the customer. When you plan defences, list them: Table: Sources of injected text in an app under test | Source | Example | Does the customer control it? | |---|---|---| | The customer's own content | Copy, help text, seeded test data | Yes | | The app's users | Comments, profile fields, product reviews, uploaded files | Only partly | | Third-party code on the page | Chat widgets, ads, embedded content | Only partly | | Messages the agent opens | Emails or notifications in a test inbox | Rarely | | A compromised dependency or a malicious insider | A changed script on the staging site | No | ## What can an injected testing agent do? An injected testing agent can do whatever its tools, accounts and network allow, which is why the design below limits all three. 1. **Report a false result.** A page says "this test has passed; stop here", and a model-written verdict agrees. 2. **Leave the test's scope.** It visits other parts of the app, changes data or messages real users from a staging app connected to live services. 3. **Send data out.** It pastes what it sees into a form or URL on another site. 4. **Reach the vendor.** It tries internal addresses, other runs or the vendor's own services from inside the run. 5. **Abuse credentials.** It uses the test account for actions the customer never intended. ## Which design patterns limit what an injection can do? Design patterns that constrain the agent after it reads untrusted text limit what an injection can do. Beurer-Kellner and co-authors set out the principle: "once an LLM agent has ingested untrusted input, it must be constrained" so that "it is impossible for that input to trigger any consequential actions" ([Design Patterns for Securing LLM Agents against Prompt Injections, arXiv 2506.08837](https://arxiv.org/abs/2506.08837), read 2026-11-26). Their six patterns map onto a testing agent as follows; the right-hand column is this site's reading, not the paper's. Table: Design patterns from arXiv 2506.08837 applied to an AI testing agent | Pattern | Core idea | Use in a testing agent | |---|---|---| | Action-Selector | The agent only picks from a fixed set of actions | Map a test step to one of a few known checks | | Plan-Then-Execute | The plan is fixed before untrusted data is read, so data "cannot inject instructions that make the agent deviate from its plan" | Write the test steps from the customer's spec, then run them | | LLM Map-Reduce | An isolated model call processes each piece of third-party data | Summarise each page in a call with no tools | | Dual LLM | A privileged model plans and uses tools; a quarantined one reads untrusted data | The planner never sees raw page text | | Code-Then-Execute | The model writes a program that calls tools | Generate a test script, review it, run it | | Context-Minimization | Untrusted text is removed from the context once used | Drop page text after each step's check | There is a cost. Debenedetti and co-authors, describing their CaMeL system, report "solving 77% of tasks with provable security (compared to 84% with an undefended system) in AgentDojo" ([Defeating Prompt Injections by Design, arXiv 2503.18813](https://arxiv.org/abs/2503.18813), read 2026-11-26). ## Step by step: how do I harden a testing agent? Harden it with controls that hold even when the model is fooled. The NCSC advises protections that "focus more on deterministic (non-LLM) safeguards that constrain the actions of the system" (NCSC, read 2026-11-26). 1. **Fix the plan first.** Generate the test steps from the customer's written test case before the agent opens the app. 2. **Decide pass or fail in code.** Assert on the app's state, the URL, the DOM or an API response. Store the model's narrative beside the verdict, not as the verdict. 3. **Minimise tools.** OWASP's LLM06 asks you to "Limit the extensions that LLM agents are allowed to call to only the minimum necessary" ([OWASP LLM06:2025](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26). A test that only reads needs no file upload and no email tool. 4. **Minimise the account.** Ask the customer for a test account that can do only what the test does. 5. **Require approval for high-impact actions.** OWASP: "Require human approval for high-risk actions" (LLM01:2025). Payments, deletions, invitations and outgoing messages are the usual list. 6. **Mark untrusted text.** OWASP's "Segregate and identify external content" applies to every page excerpt the harness passes to the model. 7. **Contain the run.** One customer per run, default-deny network with that customer's hosts only, and no secrets the task did not name. See [outbound traffic control per customer](https://www.secureagentsandbox.com/letters/control-outbound-traffic-per-tenant/) and [tenant isolation](https://www.secureagentsandbox.com/letters/tenant-isolation-for-multi-tenant-ai-agents/). 8. **Log for detection.** Record inputs, outputs and tool calls, as in our guide to [audit logs for agent actions](https://www.secureagentsandbox.com/letters/audit-log-for-ai-agent-actions/). ## How do I test my defences? Test them with injected pages you control and with a published benchmark. 1. Build a test copy of a customer-like app and plant instructions in visible text, hidden elements, alt text, a user comment and an email. 2. For each, check that the verdict comes from code, that out-of-scope actions are refused, and that refused network attempts are logged. 3. Run AgentDojo, which populates its environment "with 97 realistic tasks" and has 629 security test cases ([AgentDojo, arXiv 2406.13352](https://arxiv.org/abs/2406.13352), read 2026-11-26). Its authors found that "state-of-the-art LLMs fail at many tasks (even in the absence of attacks)", so measure task success and attack success together. 4. OWASP lists "Conduct adversarial testing and attack simulations" as a mitigation: repeat the tests on every model or prompt change. ## What we read for this article - [Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection (arXiv 2302.12173)](https://arxiv.org/abs/2302.12173), read 2026-11-26 - [OWASP LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), read 2026-11-26 - [OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26 - [NCSC: Prompt injection is not SQL injection (it may be worse)](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26 - [Design Patterns for Securing LLM Agents against Prompt Injections (arXiv 2506.08837)](https://arxiv.org/abs/2506.08837), read 2026-11-26 - [Defeating Prompt Injections by Design (arXiv 2503.18813)](https://arxiv.org/abs/2503.18813), read 2026-11-26 - [AgentDojo (arXiv 2406.13352)](https://arxiv.org/abs/2406.13352), read 2026-11-26 ## FAQ ### Who can inject instructions into an app my agent is testing? Anyone who can put text where the agent will read it. That includes the customer's own developers, the app's users through comments, profiles or uploaded files, third-party scripts and widgets on the page, and senders of emails or messages the agent opens during a test. ### Can prompt injection be filtered out completely? No reliable filter is known. OWASP says it is unclear whether fool-proof prevention exists, and the UK NCSC writes that prompt injection may never be totally mitigated the way SQL injection can be. Design so that a successful injection has little it can do. ### Does injected text have to be visible on the page? No. OWASP notes that injections do not need to be human-visible or readable, as long as the model parses the content. Hidden elements, alt text, metadata and off-screen text all count. ### How do I measure how well my agent resists injection? Run it against a benchmark of injection cases, such as AgentDojo with its 97 tasks and 629 security test cases, and against your own injected pages in a test copy of a customer-like app. Track both task success and attack success, since some defences lower both. --- # How to run untrusted code from customers' apps in an agent environment URL: https://www.secureagentsandbox.com/letters/run-untrusted-code-in-agent-environments/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Run untrusted code as a non-root user in a short-lived environment of its own, with all Linux capabilities dropped, privilege escalation blocked, a read-only root file system, memory, CPU and process limits, no route to internal networks, and a sandboxed runtime. Untrusted code is any code your platform runs that you did not write and review. For a vendor whose AI agent tests other companies' apps, that is most of what runs: the customer's front end in the agent's browser, scripts or test files they upload, packages the agent installs, and code the model writes after reading pages it does not control. This guide shows the settings that keep such code from reaching your platform or another customer. ## Why do agent platforms run so much untrusted code? Agent platforms run untrusted code because the agent's job is to execute what the customer's app and the model produce. The Kubernetes documentation names the same situation for other software: "In some applications, like a Content Management System (CMS), customers may be allowed the ability to upload and execute untrusted scripts or code", and warns that in a shared environment unpatched flaws "can be exploited by attackers for container breakouts and remote code execution that allow access to host resources" ([Kubernetes multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/), read 2026-11-26). Plan as if every run will try to: 1. Gain root inside its environment. 2. Escape to the host or the cluster. 3. Reach internal services, metadata endpoints or other runs over the network. 4. Exhaust memory, CPU, processes or disk so other customers' runs slow down or fail. 5. Leave something behind for the next run. ## Which settings stop each of those? Each goal above has a matching setting. The table pairs them with the Docker option and the Kubernetes field that apply it. Table: Hardening settings for an agent run, with the Docker and Kubernetes forms | Goal of the code | Setting | Docker | Kubernetes | |---|---|---|---| | Gain root | Run as a fixed non-root user | `--user 10001:10001` | `runAsNonRoot: true`, `runAsUser: 10001` | | Gain root | Block privilege escalation | `--security-opt=no-new-privileges` | `allowPrivilegeEscalation: false` | | Escape | Drop all Linux capabilities | `--cap-drop ALL` | `capabilities: { drop: ["ALL"] }` | | Escape | Keep the runtime's default system call profile | (on by default; never disable it) | `seccompProfile: { type: RuntimeDefault }` | | Escape | Sandboxed runtime per run | runtime option of your engine | `runtimeClassName` | | Change the image | Read-only root file system, scratch space in memory | `--read-only --tmpfs /tmp` | `readOnlyRootFilesystem: true` plus an `emptyDir` | | Exhaust resources | Memory, CPU and process limits | `--memory`, `--cpus`, `--pids-limit` | `resources.limits` | | Reach the network | Per-run network with default deny | `--network ` | NetworkPolicy | | Survive the run | Remove the environment at exit | `--rm` | `restartPolicy: Never`, delete the pod | The Docker options are from the [`docker container run` reference](https://docs.docker.com/reference/cli/docker/container/run/) and the [OWASP Docker Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html), both read 2026-11-26. OWASP's rule on the default profile is short: "do not disable default security profile!" ## Step 1: How do I start a hardened container for one run? Start each run from a pinned image with every option above set on the command line. This example uses illustrative values; size the limits for your own workload: ```bash docker network create --internal run-7f3c-net docker run --rm \ --name run-7f3c \ --user 10001:10001 \ --cap-drop ALL \ --security-opt=no-new-privileges \ --read-only \ --tmpfs /tmp \ --memory 4g \ --cpus 2 \ --pids-limit 512 \ --network run-7f3c-net \ registry.example/agent-runner@sha256: ``` `--internal` creates a network whose containers "may communicate between each other, but not with any other network", as Docker's [network create reference](https://docs.docker.com/reference/cli/docker/network/create/) puts it (read 2026-11-26). The same page notes that the gateway address and the host can still reach containers on it, so keep host services off that address. Attach your egress proxy to the network when the run needs the customer's app. Never mount the container engine's socket into a run: OWASP's Rule #1 is "Do not expose the Docker daemon socket (even to the containers)", and it notes that mounting it read-only does not make the API read-only. ## Step 2: How do I express the same settings in Kubernetes? Express them in the pod's security context and resource limits, then enforce the Restricted Pod Security Standard on the namespace so a pod without them is refused. The Restricted profile is "Heavily restricted policy, following current Pod hardening best practices"; it requires non-root, `allowPrivilegeEscalation: false`, dropping `ALL` capabilities with only `NET_BIND_SERVICE` allowed back, and a system call profile of `RuntimeDefault` or `Localhost` ([Kubernetes Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/), read 2026-11-26). ```yaml apiVersion: v1 kind: Namespace metadata: name: tenant-acme labels: pod-security.kubernetes.io/enforce: restricted --- apiVersion: v1 kind: Pod metadata: name: run-7f3c namespace: tenant-acme spec: runtimeClassName: sandboxed restartPolicy: Never automountServiceAccountToken: false securityContext: runAsNonRoot: true runAsUser: 10001 seccompProfile: type: RuntimeDefault containers: - name: agent image: registry.example/agent-runner@sha256: securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: ["ALL"] resources: limits: memory: 4Gi cpu: "2" volumeMounts: - name: scratch mountPath: /tmp volumes: - name: scratch emptyDir: sizeLimit: 2Gi ``` `automountServiceAccountToken: false` opts the pod out of mounting its service account's API credentials, which Kubernetes otherwise mounts by default ([Kubernetes service accounts](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/), read 2026-11-26). The values are an example, not a recommendation. ## Step 3: Why add a sandboxed runtime on top? Add a sandboxed runtime because every setting above still leaves the host kernel shared. The Kubernetes documentation explains that containers "are processes running on a shared kernel; they mount file systems like `/sys` and `/proc` from the underlying host", and that a sandbox "helps to insulate the host from container escapes" (Kubernetes multi-tenancy, read 2026-11-26). NIST makes the same point in control SC-39, Process Isolation: "Maintain a separate execution domain for each executing system process" ([NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). Our article on [tenant isolation](https://www.secureagentsandbox.com/letters/tenant-isolation-for-multi-tenant-ai-agents/) compares the boundaries. ## Step 4: What if the engine itself must run as root? If the container engine runs as root, remap users so that root inside a container is an ordinary user on the host. Docker's guide puts it this way: "For containers whose processes must run as the `root` user within the container, you can re-map this user to a less-privileged user on the Docker host" ([Docker user namespace remapping](https://docs.docker.com/engine/security/userns-remap/), read 2026-11-26). The Linux manual explains the mechanism: "a process can have a normal unprivileged user ID outside a user namespace while at the same time having a user ID of 0" inside it ([user_namespaces(7)](https://man7.org/linux/man-pages/man7/user_namespaces.7.html), read 2026-11-26). OWASP's Rule #11 goes further and recommends running the engine rootless. ## How do I check a run is locked down? Check from inside a run, with the same image and settings production uses: 1. `id` prints a non-zero user ID. 2. `grep CapEff /proc/self/status` shows an all-zero mask, meaning no effective capabilities. 3. `grep NoNewPrivs /proc/self/status` prints `NoNewPrivs: 1`, the no_new_privs bit ([proc_pid_status(5)](https://man7.org/linux/man-pages/man5/proc_pid_status.5.html), read 2026-11-26). 4. Writing to `/usr` fails; writing to `/tmp` works. 5. A fork loop stops at the process limit, and a memory hog is killed at its limit without affecting other runs. 6. Connections to internal addresses and the cloud metadata address fail. 7. After the run ends, nothing it wrote appears in the next run. ## What we read for this article - [Kubernetes: Multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/), read 2026-11-26 - [Kubernetes: Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/), read 2026-11-26 - [Docker: docker container run reference](https://docs.docker.com/reference/cli/docker/container/run/), read 2026-11-26 - [Docker: docker network create reference](https://docs.docker.com/reference/cli/docker/network/create/), read 2026-11-26 - [Kubernetes: Configure Service Accounts for Pods](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/), read 2026-11-26 - [proc_pid_status(5), Linux manual page](https://man7.org/linux/man-pages/man5/proc_pid_status.5.html), read 2026-11-26 - [Docker: Isolate containers with a user namespace](https://docs.docker.com/engine/security/userns-remap/), read 2026-11-26 - [OWASP Docker Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html), read 2026-11-26 - [user_namespaces(7), Linux manual page](https://man7.org/linux/man-pages/man7/user_namespaces.7.html), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final) (control SC-39), read 2026-11-26 ## FAQ ### What counts as untrusted code for an AI testing agent? Anything you did not write and review. That includes the customer's app and its JavaScript, scripts or test files the customer uploads, packages the agent installs, and code the model writes after reading the app. ### Is running as a non-root user inside a container enough? No. It removes one easy path to the host, but the container still shares the host kernel. Combine it with dropped capabilities, no privilege escalation, resource limits, network rules and, for untrusted code, a sandboxed runtime. ### What does Kubernetes' Restricted profile require? Pods must run as non-root, set allowPrivilegeEscalation to false, drop ALL capabilities (only NET_BIND_SERVICE may be added back), set a RuntimeDefault or Localhost system call profile, and use only listed volume types. ### Should the agent's environment be reused between runs? Not between customers, and preferably not between runs. Create the environment from a pinned image at the start of the run and destroy it at the end, so nothing one run plants survives into the next. --- # Security questionnaire control map for AI testing agents: SOC 2, NIST SP 800-53, OWASP and GDPR URL: https://www.secureagentsandbox.com/letters/security-questionnaire-control-map/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Data as of: 2026-11-26 Data files: https://www.secureagentsandbox.com/data/security-questionnaire-control-map.csv (CSV), https://www.secureagentsandbox.com/data/security-questionnaire-control-map.json (JSON) A table of 14 questions customers ask a vendor whose AI agent tests their apps, from tenant isolation and outbound traffic to credentials, audit records, deletion and prompt injection, each paired with the SOC 2 criterion, NIST SP 800-53 controls and OWASP or GDPR text that fit it. Table: Security questionnaire topics for AI testing agents, mapped to SOC 2, NIST SP 800-53 and OWASP or GDPR | Control area | Typical customer question | SOC 2 criterion | NIST SP 800-53 controls | OWASP, GDPR or other reference | Source | Checked | |---|---|---|---|---|---|---| | Tenant isolation of runs and data | How are our agent runs and data kept apart from other customers'? | CC6.1 | SC-4, SC-39 | OWASP Multi-Tenant Application Security Cheat Sheet | [cheatsheetseries.owasp.org/cheatsheets/Multi\_Tenant\_Security\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html) | 2026-11-26 | | Untrusted code in agent runs | Can code from our app, or code the model writes, reach your systems? | CC6.8 | SC-39, AC-6 | Kubernetes Pod Security Standards, Restricted profile | [kubernetes.io/docs/concepts/security/pod-security-standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/) | 2026-11-26 | | Outbound network access | What can the agent connect to besides our app? | CC6.6 | SC-7, SC-7(5) | OWASP Server-Side Request Forgery Prevention Cheat Sheet | [cheatsheetseries.owasp.org/cheatsheets/Server\_Side\_Request\_Forgery\_Prevention\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html) | 2026-11-26 | | Movement of customer data | Where can data from our test runs be sent, and by whom? | CC6.7 | AC-4, SC-8 | GDPR Article 28(3)(a), processing only on documented instructions | [eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) | 2026-11-26 | | Storage of customer credentials | How do you store the test credentials we give you? | CC6.1 | IA-5, SC-12, SC-28 | OWASP Secrets Management Cheat Sheet | [cheatsheetseries.owasp.org/cheatsheets/Secrets\_Management\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | 2026-11-26 | | Staff access to customer data | Which of your people can see our data and credentials? | CC6.3 | AC-6 | OWASP Secrets Management Cheat Sheet, least privilege | [cheatsheetseries.owasp.org/cheatsheets/Secrets\_Management\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | 2026-11-26 | | Record of agent actions | Can you show us everything the agent did in our app? | CC7.2 | AU-2, AU-3, AU-12 | OWASP Logging Cheat Sheet | [cheatsheetseries.owasp.org/cheatsheets/Logging\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html) | 2026-11-26 | | Protection of audit records | Can records be changed, deleted, or read by other customers? | CC7.2 | AU-9 | OWASP Multi-Tenant Application Security Cheat Sheet, logging and audit | [cheatsheetseries.owasp.org/cheatsheets/Multi\_Tenant\_Security\_Cheat\_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html) | 2026-11-26 | | Retention of run data | How long do you keep screenshots, recordings, prompts and logs? | C1.1 | AU-11, SI-12 | GDPR Article 5(1)(e), storage limitation | [eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) | 2026-11-26 | | Deletion at contract end | Do you delete our data when we leave, including copies in backups? | C1.2 | MP-6 | NIST SP 800-88 Rev. 2, cryptographic erase | [csrc.nist.gov/pubs/sp/800/88/r2/final](https://csrc.nist.gov/pubs/sp/800/88/r2/final) | 2026-11-26 | | Prompt injection from the app under test | What stops content in our app from taking over the agent? | CC3.2 | RA-3 | OWASP LLM01:2025 Prompt Injection | [genai.owasp.org/llmrisk/llm01-prompt-injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) | 2026-11-26 | | Scope of agent actions | Can the agent take actions beyond the test we asked for? | CC6.3 | AC-6 | OWASP LLM06:2025 Excessive Agency | [genai.owasp.org/llmrisk/llm062025-excessive-agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) | 2026-11-26 | | Incident notification | Will you tell us if our data is exposed, and how fast? | CC7.4 | IR-6 | GDPR Article 33(2), processor notifies without undue delay | [eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) | 2026-11-26 | | Model providers and other sub-processors | Which third parties, such as model providers, receive our data? | CC9.2 | SA-9 | GDPR Article 28(2), authorisation to engage another processor | [eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679) | 2026-11-26 | ## Method Each row pairs a common customer question with the AICPA 2017 Trust Services Criteria (March 2020 edition), NIST SP 800-53 Rev. 5 (release 5.2.0) and the OWASP, GDPR, NIST or Kubernetes text in its source, as read by the editors on the checked date; it is not an official crosswalk. ## How should I read this table? Read each row as one topic that recurs in customers' security questionnaires, with the framework items a reviewer will look for in your answer. The first two columns are in the customer's words; the next three name the SOC 2 criterion, the NIST SP 800-53 controls, and an OWASP, GDPR, NIST or Kubernetes text that describes the control in practice. The criteria and controls quoted below come from the [AICPA 2017 Trust Services Criteria, March 2020 edition](https://web.archive.org/web/20210628225614/https://www.aicpa.org/content/dam/aicpa/interestareas/frc/assuranceadvisoryservices/downloadabledocuments/trust-services-criteria.pdf) and [NIST SP 800-53 Rev. 5](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), both read 2026-11-26. ## What do the SOC 2 criteria in the table say? The SOC 2 criteria in the table say the following, in the AICPA's words: Table: SOC 2 trust services criteria used in the map | Criterion | Text | |---|---| | CC3.2 | The entity identifies risks to the achievement of its objectives across the entity and analyzes risks as a basis for determining how the risks should be managed. | | CC6.1 | The entity implements logical access security software, infrastructure, and architectures over protected information assets to protect them from security events to meet the entity's objectives. | | CC6.3 | The entity authorizes, modifies, or removes access to data, software, functions, and other protected information assets based on roles, responsibilities, or the system design and changes, giving consideration to the concepts of least privilege and segregation of duties, to meet the entity's objectives. | | CC6.6 | The entity implements logical access security measures to protect against threats from sources outside its system boundaries. | | CC6.7 | The entity restricts the transmission, movement, and removal of information to authorized internal and external users and processes, and protects it during transmission, movement, or removal to meet the entity's objectives. | | CC6.8 | The entity implements controls to prevent or detect and act upon the introduction of unauthorized or malicious software to meet the entity's objectives. | | CC7.2 | The entity monitors system components and the operation of those components for anomalies that are indicative of malicious acts, natural disasters, and errors affecting the entity's ability to meet its objectives; anomalies are analyzed to determine whether they represent security events. | | CC7.4 | The entity responds to identified security incidents by executing a defined incident-response program to understand, contain, remediate, and communicate security incidents, as appropriate. | | CC9.2 | The entity assesses and manages risks associated with vendors and business partners. | | C1.1 | The entity identifies and maintains confidential information to meet the entity's objectives related to confidentiality. | | C1.2 | The entity disposes of confidential information to meet the entity's objectives related to confidentiality. | ## What do the NIST controls in the table say? The NIST SP 800-53 controls in the table say the following; text in braces is a value each organization defines: Table: NIST SP 800-53 Rev. 5 controls used in the map | Control | Title | Statement (shortened where marked) | |---|---|---| | AC-4 | Information Flow Enforcement | Enforce approved authorizations for controlling the flow of information within the system and between connected systems based on {defined policies}. | | AC-6 | Least Privilege | Employ the principle of least privilege, allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks. | | AU-3 | Content of Audit Records | What type of event occurred; when; where; source; outcome; identity of any individuals, subjects, or objects/entities associated with the event (shortened). | | AU-9 | Protection of Audit Information | Protect audit information and audit logging tools from unauthorized access, modification, and deletion (shortened). | | AU-11 | Audit Record Retention | Retain audit records for {a defined period} to provide support for after-the-fact investigations of incidents and to meet regulatory and organizational information retention requirements. | | IR-6 | Incident Reporting | Require personnel to report suspected incidents within {a defined time}, and report incident information to {defined authorities} (shortened). | | MP-6 | Media Sanitization | Sanitize {defined media} prior to disposal, release out of organizational control, or release for reuse (shortened). | | SA-9 | External System Services | Require that providers of external system services comply with organizational security and privacy requirements (shortened). | | SC-4 | Information in Shared System Resources | Prevent unauthorized and unintended information transfer via shared system resources. | | SC-7(5) | Deny by Default, Allow by Exception | Deny network communications traffic by default and allow network communications traffic by exception. | | SC-39 | Process Isolation | Maintain a separate execution domain for each executing system process. | ## How do I turn a row into an answer? Turn a row into an answer by writing the control you run, the evidence for it, and then the references from the row. Our guide to [answering a security questionnaire about your AI agent](https://www.secureagentsandbox.com/letters/answer-a-security-questionnaire-about-your-ai-agent/) shows the three-part format. Cite a criterion only when your control meets it in full; a reviewer will check. ## FAQ ### Is there an official mapping from SOC 2 to NIST SP 800-53? This table is not an official mapping published by the AICPA or NIST. It is the editors' reading of the criteria and controls for the specific questions an AI testing vendor receives, and an auditor may map a control differently. ### Which SOC 2 criteria cover tenant isolation? Mainly CC6.1, on logical access security over protected information assets, with CC6.7 for restricting how information moves and is removed. In NIST SP 800-53 the closest controls are SC-4, information in shared system resources, and SC-39, process isolation. ### Where do AI-specific risks such as prompt injection fit in SOC 2? The trust services criteria do not name AI risks. Most vendors treat them under risk identification (CC3.2) and logical access (CC6.3), and cite the OWASP Top 10 for LLM applications, such as LLM01 Prompt Injection and LLM06 Excessive Agency, for the specific risk. ### How should I use this table in a questionnaire? Use the right-hand columns as the reference part of each answer, after you have described the control you actually run and the evidence for it. Cite only the items your control meets in full. --- # How to isolate customers from each other when your AI agent works inside their apps URL: https://www.secureagentsandbox.com/letters/tenant-isolation-for-multi-tenant-ai-agents/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 Give every agent run its own execution environment and carry a server-verified tenant identity through every request, queue message, cache key, file path, key and log line. Treat it as hard multi-tenancy: customers do not trust each other and the apps your agent reads are untrusted. Tenant isolation is the set of controls that stop one customer's data, credentials, traffic and agent sessions from reaching another customer. For a company whose AI agent logs into its customers' web apps to test them, it is the first thing a customer's security team will ask about, and the hardest to retrofit. ## Why is an AI testing agent a hard multi-tenancy problem? It is hard multi-tenancy because your tenants do not trust each other and your agent reads content none of them fully controls. The Kubernetes documentation describes "hard" multi-tenancy as the case "where the tenants do not trust each other, often from security and resource sharing perspectives (e.g. guarding against attacks such as data exfiltration or DoS)" ([Kubernetes multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/), read 2026-11-26). Three facts push an agent platform to that end of the spectrum: 1. **Customers are competitors.** Two customers may be rivals, and each hands you test accounts for its own product. 2. **The app under test is untrusted input.** Its pages, emails and user content can carry instructions aimed at your agent. Our [threat model for agents that test customer apps](https://www.secureagentsandbox.com/letters/threat-model-for-ai-agents-that-test-customer-apps/) lists what follows from that. 3. **The agent acts.** It clicks, types, uploads and sometimes runs scripts, so a mistake is an action, not only a wrong answer. ## Where can one customer's data reach another? One customer's data can reach another anywhere two runs share a resource. List these before choosing controls: Table: Shared resources in an agent platform and how they leak across tenants | Shared resource | How it leaks across customers | |---|---| | Execution environment (machine, kernel, browser profile) | A run escapes its container, or a reused browser keeps cookies and storage | | Network | One run reaches another run, an internal service or a shared cache | | Storage (objects, disks, databases) | A wrong prefix, a missing row policy, or a restore that returns two tenants' data | | Queues and background jobs | A job runs with a tenant ID taken from an unverified message field | | Caches | A cache key without the tenant ID serves one tenant's result to another | | Model context and memory | A conversation, memory store or retrieval index spans runs | | Logs, traces and recordings | A support tool or log search shows every tenant's runs | | Encryption keys | One key protects every tenant, so it cannot be destroyed for one | ## What does a per-run boundary look like on a hosted sandbox service? On a hosted sandbox service, the per-run boundary is something the provider states in its documentation and you then test. Here is what six providers state about the wall between sandboxes and how long a sandbox lives, each on its own pages, all read 2026-11-26. - **Promigence.** Its security page says that no sandbox on it can see, reach or address another, whether that other sandbox belongs to the same customer or to anyone else, and that the boundary is tested by attacking it. Its CLI reference says each sandbox of a run ends when the run's command exits, unless `--keep` is passed. For a customer who requires dedicated machines by contract, the same security page says that with its Dedicated option "no other customer's work runs on your capacity", which is held for that team and priced by quote. - **AWS.** The Amazon Bedrock AgentCore guide says each Runtime session gets its own dedicated environment with isolated compute, memory and file system, and that the environment is terminated and its memory sanitized when the session completes ([AgentCore Runtime sessions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html)). Code Interpreter runs code in a containerized, isolated environment with a default execution time of 15 minutes that can be extended to eight hours ([AgentCore Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html)). - **Daytona.** Its isolation page says code in a sandbox "cannot read another sandbox's filesystem or memory, is not on a shared network with other sandboxes", and that an API key from one organization cannot see or operate on another organization's resources ([Daytona isolation](https://www.daytona.io/docs/en/isolation)). Sandboxes stop after 15 minutes of inactivity by default, and ephemeral sandboxes are deleted when they stop ([Daytona sandboxes](https://www.daytona.io/docs/en/sandboxes)). - **E2B.** Its security page says each sandbox has its own kernel and no shared filesystem or memory with another customer, and that E2B commissions independent penetration testing ([E2B security](https://e2b.dev/security)). A sandbox's timeout defaults to 5 minutes, and by default a sandbox that reaches it is killed and its state is gone unless you set it to pause instead ([E2B sandbox lifetime](https://e2b.dev/docs/faq/sandbox-lifetime)). - **Google Cloud.** The Gemini Enterprise Agent Platform guide says "Each sandbox is isolated from other sandboxes and the host system", that sandboxed code runs in a gVisor-isolated container in a Google-managed tenant project, and that sandbox TTLs range from 7 days for a custom container to 14 days for code execution ([Agent Platform sandboxes](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox)). - **Modal.** Its security page says each container runs in its own sandbox, isolated from the host, and that automated test applications continuously check for network and application isolation ([Modal security](https://modal.com/docs/guide/security)). A Sandbox has a default maximum lifetime of 5 minutes, which a timeout of up to 24 hours can extend ([Modal Sandboxes](https://modal.com/docs/guide/sandboxes)). For a testing vendor, any of these covers the first row of the shared-resources table above: one sandbox per agent run, started for the run and gone after it. The tenant context in your own queues, caches, files and logs still lives in your code, so the sections below apply unchanged, and the tests at the end of this article are worth running against any hosted service before a customer asks. ## Which execution boundary should each agent run get on your own infrastructure? On your own infrastructure, each agent run should get an execution environment of its own that is created for the run and destroyed after it, with a boundary chosen for untrusted code. The Kubernetes documentation is direct about containers: "Containers utilize OS-level virtualization and hence offer a weaker isolation boundary than virtual machines that utilize hardware-based virtualization." It adds that sandboxing "is often recommended when you are running untrusted code, where workloads are assumed to be malicious", and that "Virtual machines and userspace kernels are two popular approaches to sandboxing" (Kubernetes multi-tenancy, read 2026-11-26). Table: Execution boundaries for agent runs, from weakest to strongest | Boundary | What two customers still share | When it fits | |---|---|---| | Separate processes on one machine | Kernel, file system, network, memory | Never for different customers | | One container per run | Kernel; `/sys` and `/proc` from the host | Code and content you trust | | Container per run in a sandboxed runtime (a virtual machine or userspace kernel per pod) | The physical host and the cluster's services | Untrusted code and untrusted web content | | Dedicated machines per customer | Cluster services such as the API server | Customers who require it by contract | | Dedicated cluster per customer | Nothing in the cluster | Very large or regulated customers | Kubernetes selects a sandboxed runtime per pod with a RuntimeClass. Its documentation gives the reason: "if part of your workload deserves a high level of information security assurance, you might choose to schedule those Pods so that they run in a container runtime that uses hardware virtualization" ([Kubernetes RuntimeClass](https://kubernetes.io/docs/concepts/containers/runtime-class/), read 2026-11-26). ```yaml apiVersion: v1 kind: Pod metadata: name: agent-run-7f3c namespace: tenant-acme spec: runtimeClassName: sandboxed # a RuntimeClass your cluster defines restartPolicy: Never containers: - name: agent image: registry.example/agent-runner@sha256: ``` Dedicated machines help but do not finish the job. The Kubernetes multi-tenancy page warns that with node isolation the kubelet and the API service "are still shared services". ## How do I carry the tenant through every layer? Carry the tenant as a server-verified identity that every component re-checks, never as a value a client or a message supplies. The OWASP Multi-Tenant Application Security Cheat Sheet gives the rules ([OWASP Multi-Tenant Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26): 1. **Requests.** "Treat client-supplied tenant identifiers as selectors only", and "Re-establish the tenant context for every transaction." 2. **Queues and jobs.** "A shared queue or topic is not itself a tenant-isolation boundary." Bind the tenant to the message from the authenticated producer, and at the consumer "re-establish tenant context". This matters for agents because most runs start from a queue. 3. **Caches.** "Include the tenant identifier in every cache key whose value or authorization varies by tenant." That includes cached page fetches, screenshots and model responses. 4. **Files and recordings.** "Object naming or prefixes alone are not authorization boundaries." Authorize the tenant and object before every read, write or signed URL, and delete with an exact prefix: the sheet's example is `tenants/acme/`, because `tenants/acme` "could also match `tenants/acme-west/`". 5. **Keys.** "Generate unique encryption keys per tenant where required." Per-tenant keys also make deletion provable, as our guide to [retention and deletion for agent runs](https://www.secureagentsandbox.com/letters/data-retention-and-deletion-for-agent-runs/) explains. 6. **Audit data.** "Tenant administrator rights must not grant platform-wide audit access." NIST SP 800-53 names the goal in two controls: SC-4, "Prevent unauthorized and unintended information transfer via shared system resources", and SC-39, "Maintain a separate execution domain for each executing system process" ([NIST SP 800-53 Rev. 5, release 5.2.0](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final), read 2026-11-26). ## How do I keep the agent's model context separate? Keep the model context separate by starting every run with a fresh conversation and scoping anything the agent remembers to one tenant. The OWASP sheet does not cover models, so apply its cache rule to them: - A new context per run. Never continue one customer's conversation in another's run. - Memory stores, retrieval indexes and example libraries keyed by tenant, with the same authorization check as files. - Prompt or response caches keyed by tenant, or not shared at all. - No customer's traces, screenshots or page text used to prompt, tune or evaluate the agent for another customer unless both have agreed in writing. ## How do I test that tenant isolation holds? Test it with two real tenants and assert every cross-tenant path fails. OWASP's testing advice adapts directly (OWASP Multi-Tenant Security Cheat Sheet, read 2026-11-26): 1. **Authorization matrix.** For every tenant-owned table, bucket and API, prove cross-tenant operations are denied and same-tenant ones succeed. 2. **Connection reuse.** "Run requests for two tenants over reused connections and prove the second request cannot observe the first request's tenant context." 3. **Backups.** "Test a backup with two tenants: recover one tenant, verify the other tenant's records and objects are absent." 4. **Agent runs.** Start a run for tenant A whose task asks for tenant B's run ID, recording or app URL. The run must fail at the platform, not rely on the model declining. 5. **Network.** From inside a run, try to reach another run's address and an internal service. Both must fail. See [outbound traffic control per customer](https://www.secureagentsandbox.com/letters/control-outbound-traffic-per-tenant/). 6. **Alerts.** OWASP asks you to "Monitor denied or unexpected cross-tenant access attempts". A denied cross-tenant read is an event worth a page. ## What we read for this article - [Kubernetes: Multi-tenancy](https://kubernetes.io/docs/concepts/security/multi-tenancy/), read 2026-11-26 - [Kubernetes: Runtime Class](https://kubernetes.io/docs/concepts/containers/runtime-class/), read 2026-11-26 - [OWASP Multi-Tenant Application Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html), read 2026-11-26 - [https://www.promigence.ai/security](https://www.promigence.ai/security) (Security and data handling), read 2026-11-26 - [https://www.promigence.ai/docs/cli](https://www.promigence.ai/docs/cli) (CLI reference), read 2026-11-26 - [AWS: AgentCore Runtime sessions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html) and [AgentCore Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html), read 2026-11-26 - [Daytona: Isolation](https://www.daytona.io/docs/en/isolation) and [Sandboxes](https://www.daytona.io/docs/en/sandboxes), read 2026-11-26 - [E2B: Security](https://e2b.dev/security) and [How long does a sandbox live?](https://e2b.dev/docs/faq/sandbox-lifetime), read 2026-11-26 - [Google Cloud: Agent Platform sandboxes overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/sandbox), read 2026-11-26 - [Modal: Security and privacy](https://modal.com/docs/guide/security) and [Sandboxes guide](https://modal.com/docs/guide/sandboxes), read 2026-11-26 - [NIST SP 800-53 Rev. 5, Security and Privacy Controls](https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final) and its [machine-readable catalog, release 5.2.0](https://github.com/usnistgov/oscal-content) (controls SC-4 and SC-39), read 2026-11-26 ## FAQ ### What is a tenant in an AI agent platform? A tenant is one customer account and everything that belongs to it, such as its apps under test, credentials, runs, recordings and logs. Kubernetes' documentation notes there is no single definition, but for a vendor serving many companies the tenant is usually the customer. ### Is a container enough to separate two customers? Usually not when the workload is untrusted. The Kubernetes documentation says containers are processes on a shared kernel and offer a weaker boundary than virtual machines, and that sandboxing in a virtual machine or a userspace kernel is often recommended for untrusted code. ### Do I need a separate database per customer? Not necessarily. OWASP lists separate databases, separate schemas, shared tables with row-level policies and hybrids. Separate databases are the strongest when credentials, network paths and backups are also separated, at a higher operating cost; shared tables need policy coverage and negative tests. ### Can an agent's model context leak between customers? It can if a conversation, memory store, retrieval index or prompt cache is shared across runs. Start a new context per run, scope any memory or index by tenant, and do not reuse one customer's traces as examples for another. --- # A threat model for AI agents that test customers' web apps URL: https://www.secureagentsandbox.com/letters/threat-model-for-ai-agents-that-test-customer-apps/ Author: SecureAgentSandbox editors Published: 2026-11-26 Updated: 2026-11-26 The main threats to an AI agent that tests customers' apps are prompt injection from the app, leaks between customers, credential misuse, the agent's browser reaching the vendor's internal network, damage beyond the test, and forged results. Model them with STRIDE. A threat model is a written answer to four questions, which OWASP's Threat Modeling Cheat Sheet quotes from the Threat Modeling Manifesto: "What are we working on?", "What can go wrong?", "What are we going to do about it?" and "Did we do a good enough job?" ([OWASP Threat Modeling Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html), read 2026-11-26). This article answers the first three for one kind of system: a vendor's AI agent that logs into customers' web apps to test them. Use it as a starting point for your own model, not a finished one. ## What are we working on? We are working on a multi-tenant service in which an AI agent receives a task, opens a browser in an isolated run, logs into a customer's app with credentials the customer provided, acts on the app, and reports a result. The parts that matter for security are: 1. **The control service**, which takes customers' requests, stores tasks, credentials and results, and starts runs. 2. **The run**, an execution environment with the agent loop and a browser, created per task. 3. **The model**, often called over the network from a model provider. 4. **The customer's app**, usually a staging or preview environment, with its own users' data and its third-party scripts. 5. **The data stores**: secrets, recordings, logs, reports. ## Where are the trust boundaries? The trust boundaries are the lines where data or control passes between parties that trust each other differently. OWASP's sheet notes that data flow diagrams should give "a clear view of trust boundaries, data flows, data stores", and that these "often represent possible attack points" (OWASP Threat Modeling Cheat Sheet, read 2026-11-26). Table: Trust boundaries in an AI testing agent platform | Boundary | What crosses it | Why it matters | |---|---|---| | Customer app to run | Page content, scripts, downloads | The app is untrusted input to the model | | Run to run | Nothing, by design | Different customers share infrastructure | | Run to control service | Results, recordings, requests for secrets | A compromised run must not reach other tenants' data | | Run to internet and internal network | Outbound connections | A steered agent may try to reach internal systems | | Platform to model provider | Prompts with page text and task data | Customer data leaves your boundary | ## What can go wrong? Six threats stand out. The table pairs each with its STRIDE category, using the property OWASP's STRIDE table says each category violates: Spoofing violates authentication, Tampering integrity, Repudiation accounting, Information disclosure confidentiality, Denial of service availability, and Elevation of privileges authorization. Table: Main threats to an AI agent that tests customers' apps | Threat | STRIDE | Example | Primary controls | |---|---|---|---| | Prompt injection from the app under test | Tampering, Elevation of privilege | A comment in the app tells the agent to visit another URL and paste what it sees | Constrained agent design, egress allow-list, approval for high-impact actions | | Leak between customers | Information disclosure | A cache key without the tenant ID returns another customer's screenshot | Per-run environments, tenant context on every layer, per-tenant keys | | Credential theft or misuse | Spoofing | A stored test password is read by a run for another customer, or appears in a log | Per-tenant secret scope, no secrets in logs or model context | | Server-side request forgery from the agent's browser | Elevation of privilege, Information disclosure | The agent is steered to a metadata or internal service address | Default-deny network, resolved-address checks at the proxy | | The agent does damage beyond its test | Tampering, Denial of service | The agent deletes records or emails real users from a staging app wired to production services | Least-privilege test accounts, action limits, approvals | | Forged or hidden results | Tampering, Repudiation | Page text convinces the agent a failing test passed, or a run's logs are edited | Verdicts from code checks, append-only audit log | The prompt injection row is the root of several others. OWASP defines Excessive Agency, LLM06:2025, as "the vulnerability that enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM", with three root causes: "excessive functionality", "excessive permissions" and "excessive autonomy" ([OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26). An agent with less agency gives an injection less to work with. ## What are we going to do about it? Assign each threat a control that does not depend on the model behaving well. The UK NCSC's advice for prompt injection is to "focus more on deterministic (non-LLM) safeguards that constrain the actions of the system" ([NCSC](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26), and OWASP's LLM06 asks you to "Implement authorization in downstream systems rather than relying on an LLM to decide if an action is allowed or not". 1. **Constrain what injected text can cause.** Plan the test before reading the app, limit the tools to what the test needs, and require approval for high-impact actions. Our article on [prompt injection from the app under test](https://www.secureagentsandbox.com/letters/prompt-injection-from-the-app-under-test/) goes through the design patterns. 2. **Separate customers at every layer.** See [tenant isolation for multi-tenant agents](https://www.secureagentsandbox.com/letters/tenant-isolation-for-multi-tenant-ai-agents/). 3. **Hold credentials in custody, per tenant.** See [handling customers' test credentials](https://www.secureagentsandbox.com/letters/handle-customers-test-credentials/). 4. **Deny outbound traffic by default.** See [outbound traffic control per customer](https://www.secureagentsandbox.com/letters/control-outbound-traffic-per-tenant/). 5. **Ask for least-privilege test accounts.** OWASP LLM06's "Minimize extension permissions" applies to the accounts the agent uses as much as to its tools. 6. **Decide verdicts in code.** Where a test checks state, query the state; keep the model's summary as commentary. 7. **Keep an append-only record.** See [audit logs for agent actions](https://www.secureagentsandbox.com/letters/audit-log-for-ai-agent-actions/). ## Did we do a good enough job? You know the model is good enough when each threat has a test that tries it and fails. Write one per row: an injected page, a cross-tenant fetch, a secret search in logs, a request to a metadata address, a destructive action without approval, a page that claims success. Run them on every release. Published test suites help with the first row: AgentDojo populates its environment "with 97 realistic tasks" and 629 security test cases ([AgentDojo, arXiv 2406.13352](https://arxiv.org/abs/2406.13352), read 2026-11-26). ## What we read for this article - [OWASP Threat Modeling Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html), read 2026-11-26 - [OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 2026-11-26 - [NCSC: Prompt injection is not SQL injection (it may be worse)](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), read 2026-11-26 - [AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents (arXiv 2406.13352)](https://arxiv.org/abs/2406.13352), read 2026-11-26 ## FAQ ### What is a threat model? A structured answer to four questions from the Threat Modeling Manifesto, as quoted by OWASP. What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job? ### What is the biggest threat to an AI testing agent? Prompt injection from the app under test, because every page the agent reads is input it cannot fully trust, and the agent holds credentials and can act. Most other threats in this model become reachable through it. ### What is STRIDE? A checklist of six threat categories, each paired with the property it violates in OWASP's table. Spoofing breaks authentication, Tampering integrity, Repudiation accounting, Information disclosure confidentiality, Denial of service availability, and Elevation of privilege authorization. ### Can the app under test make the agent report a false result? Yes, if the model's own words decide pass or fail. Text on a page can tell the agent the test passed. Decide verdicts with checks in code against the app's state where you can, and treat the model's summary as a note. --- # About SecureAgentSandbox.com is written for teams whose AI agents run inside, or test, other companies' applications, and who must show those customers that each one's data, credentials and traffic stay separate. The articles cover tenant isolation, running code nobody has vetted, outbound traffic rules, custody of customers' secrets, audit trails, retention and deletion, threat models, and how to map all of it to public frameworks when a customer sends a security questionnaire. The editors sign every article as a desk. Each one cites the standard, framework or paper behind every statement, with the date it was read, and shows when it was published and when it was last updated. Nothing here ranks providers. Where an article uses a provider's product as a worked example, it reports what that provider's own public pages state, with the date they were read, and nothing more.