# Practical ways to use the Claude Agent SDK
🛡 Build defense in depth with prompt injection countermeasures, credential proxies, and least privilege.
Secure Deployment provides isolation techniques, credential proxy patterns, and network/filesystem controls for safe production agent operation.
📌 Title: Deploying AI Agents Securely
🔗 URL:
🧩 Overview
Combines sandbox-runtime / Docker / gVisor / Firecracker isolation, credential proxy patterns, and network/filesystem controls for multi-layered defense.
🛠 How to use it
Choose isolation by threat level: sandbox-runtime for single developer/CI, gVisor/Firecracker for multi-tenant or untrusted content. Inject credentials via Envoy / mitmproxy / LiteLLM proxies outside the agent boundary.
🏗 Practical usage
- Credential proxy pattern: inject API keys at a proxy outside the agent boundary. The agent calls APIs without ever seeing credentials. Route via `ANTHROPIC_BASE_URL`.
- Least privilege: mount only required directories as read-only, exclude `.env` / `~/.aws/credentials` / `*.pem`, use `--network none` + Unix socket proxy.
- In cloud environments, use private subnets + cloud firewalls to block all outbound except through the proxy, which enforces allow-lists, injects credentials, and logs all traffic.
💡 Use cases
🔐 Credential management outside agent boundaries
🌐 Network restrictions preventing unauthorized data exfiltration
🏢 Strong isolation for multi-tenant environments
⚠️ Watch out
Untrusted content (READMEs, web pages, user input) may contain prompt injection attempts. Network controls are your last line of defense — always configure them.
#
ClaudeAgentSDK# #
AI#