Guide #15 Act 3 — Security 14 min read March 2026

Security for AI Agents
in Production

This is the guide you send to your CISO the day before the security review. AI agents execute code autonomously, access credentials, and interact with production systems. Your security team has questions. This guide has answers.

Why AI agents are a new security surface

Traditional software executes deterministic code written by your engineers, reviewed in a PR, tested in CI, and deployed through a controlled pipeline. You know exactly what it will do because a human wrote every line.

AI agents are different. They execute LLM-generated code — code that didn't exist until the model produced it at runtime. They make autonomous decisions about what commands to run, what APIs to call, and what data to process. They interact with external systems (websites, portals, APIs) that can contain adversarial inputs designed to manipulate the agent's behavior (prompt injection).

This isn't hypothetical. In 2025, researchers demonstrated prompt injection attacks that caused AI agents to exfiltrate environment variables, execute unauthorized commands, and bypass safety filters — all through carefully crafted content on webpages the agent visited. The OWASP Top 10 for LLM Applications lists prompt injection as the #1 risk.

The response isn't to avoid deploying AI agents. It's to deploy them with the right security architecture. The same way you don't avoid deploying web applications — you deploy them with firewalls, WAFs, input validation, and least-privilege access.

The five questions your security team will ask

1. "What's the blast radius if an agent is compromised?"

Answer: a single disposable sandbox. Every agent runs in its own isolated environment — its own VM (EC2) or its own container (cloud). It cannot see other agents' filesystems, processes, or network traffic. If compromised, the worst case is destruction of that one sandbox. The agent cannot laterally move to other sandboxes, to the platform infrastructure, or to your production systems (unless you explicitly gave it network access to those systems, which is controlled by egress rules).

Compare to running Claude Code on an engineer's laptop: the blast radius is the engineer's entire machine, credentials, and network access.

2. "Where do credentials live?"

Answer: they don't live. They visit. Credentials are injected at runtime and expire after the task. SSH access uses short-lived certificates (1–4 hour TTL). API keys are fetched from a secrets manager when the sandbox boots and are scoped to the minimum permissions the task requires. Vendor portal passwords are injected as environment variables, used, and destroyed when the container is released.

Nothing is stored on disk permanently. The ephemeral containers don't have a ~/.ssh/id_rsa sitting around. The persistent sandboxes use certificates that expire before anyone could exploit a leaked key.

3. "Can the agent send data to external systems?"

Answer: only if you allow it. Egress control is configurable per sandbox via security groups. For agents handling sensitive data, restrict outbound traffic to an explicit allowlist: the model API (api.anthropic.com), your internal endpoints, and nothing else. A compromised agent that tries to curl data to an external server gets a connection refused.

For agents that need internet access (web research, competitive intelligence), the tradeoff is explicit. You're choosing broader network access in exchange for the agent's ability to browse. The other controls (isolation, ephemeral credentials, audit logging) still apply.

4. "Is there an audit trail?"

Answer: every action, every timestamp, every user. The platform logs sandbox creation, command execution, file uploads/downloads, container lifecycle events, and API calls. Each entry includes: who triggered the action, when, what resource was affected, and the full details (command text, response code, file name). The log is immutable and exportable to your SIEM.

For desktop and browser containers, session recordings provide visual audit: a video of what the agent saw and did, stored alongside the task output. SOC2 auditors can replay exactly what happened.

5. "What happens when an agent goes rogue?"

Answer: the architecture contains it. Walk through the scenario: a prompt injection on a scraped webpage tricks the agent into attempting data exfiltration.

  1. Egress control blocks the request (destination not in allowlist). Data stays in the sandbox.
  2. Audit log records the attempted command, including the target URL.
  3. Alert fires on the blocked egress attempt. Security team is notified.
  4. Credentials expire within hours regardless.
  5. Sandbox is destroyed after the task, eliminating any persistence.

Worst case: the agent wasted 5 minutes of compute on a failed attempt. No data left the sandbox. No credentials were compromised. The incident is logged and alerted.

The six security layers

Defense in depth. No single control is sufficient. All six work together.

LayerWhat it protects againstImplementation
1. Compute isolation Lateral movement, cross-agent contamination Each agent: own EC2/cloud containers, own filesystem, own network interface
2. Short-lived credentials Credential theft, persistent access SSH certificates (1–4 hr), scoped API keys, no static passwords on disk
3. Egress control Data exfiltration, command & control Security group allowlist: only approved outbound destinations
4. Audit logging Undetected activity, compliance gaps Immutable log of every action, exportable to SIEM
5. Session recording Unverifiable agent behavior, compliance evidence Video capture of desktop/browser sessions, screenshots per step
6. Ephemeral by default Persistent compromise, data accumulation Sandbox destroyed after task; credentials, state, data all gone
Compare to the alternative: AI agents on developer laptops

Without the platform, Claude Code runs on an engineer's MacBook with: full filesystem access, all SSH keys, all AWS credentials, all browser cookies, unrestricted internet access, no audit log, no session recording, no egress control. Every one of the six security layers above is absent. The platform doesn't just enable AI agents — it makes them safer than the alternative.

Compliance mapping

RequirementSOC2GDPRHIPAAHow it's met
Access controlCC6.1Art. 25164.312(a)Multi-tenant org isolation, role-based permissions, cross-tenant restricted
Audit trailCC7.2Art. 30164.312(b)Immutable log of every action with user identity and timestamp
Encryption at restCC6.7Art. 32164.312(a)(2)EBS volumes encrypted with AES-256
Encryption in transitCC6.7Art. 32164.312(e)TLS 1.3 for all API calls, SSH for sandbox access
Data minimizationArt. 5(1)(c)Ephemeral sandboxes: data processed and destroyed per task
Right to erasureArt. 17Delete sandbox = delete all data. Audit log retains action record only.
Change managementCC8.1Agent task descriptions in git, reviewed before deployment

The security case for the platform (vs no platform)

The alternative to running AI agents on a managed platform isn't "no AI agents." It's "AI agents running on engineer laptops with zero controls." That's the actual threat model your security team should worry about.

Security propertyAgent on engineer's laptopAgent on managed platform
Blast radiusEntire laptop + credentialsOne disposable sandbox
Credential accessAll user credentialsScoped, short-lived only
Network controlUnrestricted internetConfigurable egress rules
Audit trailNoneEvery action logged
Session recordingNoneVideo + screenshots
Multi-tenant isolationN/AOrg-level boundaries
Emergency killClose laptop lid?API: delete sandbox in seconds

The managed platform is strictly more secure than the unmanaged alternative. Every security property improves. The conversation with your security team should be: "We're already using AI agents. The question is whether they run on laptops with no controls, or on a platform with six layers of defense."

The security review checklist

Give this to your security team before the review meeting:

  1. Compute isolation: each agent runs in its own EC2 instance or cloud container. No shared compute. Verified by VPC and security group configuration.
  2. Credential management: short-lived SSH certificates (1–4 hr TTL), scoped API keys fetched at runtime, no static secrets on disk.
  3. Network control: egress rules configurable per sandbox. Sensitive workloads restricted to allowlisted endpoints.
  4. Audit logging: immutable log of every action. Exportable to SIEM. Includes user identity, timestamp, action, resource, and details.
  5. Session recording: video capture for desktop/browser containers. Screenshot archive for every step.
  6. Ephemeral default: sandboxes and containers destroyed after task completion. No persistent state beyond the task window.
  7. Spending caps: per-user limits prevent a compromised account from provisioning unlimited resources.
  8. Emergency termination: any sandbox can be killed via API in seconds.
  9. Compliance: SOC2 (CC6, CC7, CC8), GDPR (Art. 5, 17, 25, 30, 32), HIPAA (164.312) patterns documented.

What's next

Secure by architecture

Six layers of defense. Isolation. Short-lived credentials. Egress control. Audit trail. The security your CISO needs to say yes.

Get Started Free