Caging the Agents: A Zero Trust Security Architecture for Autonomous AI in Healthcare
Organizations: VP of Trust, Commure · Founder & CEO, nFactor Technologies
Abstract
Autonomous AI agents powered by large language models are being deployed in production with capabilities including shell execution, file system access, database queries, and multi-party communication. Recent red teaming research demonstrates that these agents exhibit critical vulnerabilities in realistic settings: unauthorized compliance with non-owner instructions, sensitive information disclosure, identity spoofing, cross-agent propagation of unsafe practices, and indirect prompt injection through external resources [7]. In healthcare environments processing Protected Health Information, every such vulnerability becomes a potential HIPAA violation. This paper presents a security architecture deployed for nine autonomous AI agents in production at a healthcare technology company. We develop a six-domain threat model for agentic AI in healthcare covering credential exposure, execution capability abuse, network egress exfiltration, prompt integrity failures, database access risks, and fleet configuration drift. We implement four-layer defense in depth: (1) kernel level workload isolation using gVisor on Kubernetes, (2) credential proxy sidecars preventing agent containers from accessing raw secrets, (3) network egress policies restricting each agent to allowlisted destinations, and (4) a prompt integrity framework with structured metadata envelopes and untrusted content labeling. We report results from 90 days of deployment including four HIGH severity findings discovered and remediated by an automated security audit agent, progressive fleet hardening across three VM image generations, and defense coverage mapped to all eleven attack patterns from recent literature. All configurations, audit tooling, and the prompt integrity framework are released as open source.
Figures & tables
| Domain | HIPAA Provision | Validated By | Severity |
|---|---|---|---|
| Credential Exposure | 164.312(a) Access Controls | Our fleet audit (H1–H4) | Critical |
| Execution Abuse | 164.312(a), 164.308(a)(4) | Shapira CS#2, CS#4 | Critical |
| Network Egress | 164.312(e) Transmission Security | Shapira CS#11 | Critical |
| Prompt Integrity | 164.312(a), 164.308(a)(5) | Shapira CS#8, CS#10 | High |
| Database Access | 164.312(b) Audit Controls | Shapira CS#3 | Critical |
| Fleet Drift | 164.308(a)(8) Evaluation | Our fleet audit | Medium |
| ID | Severity | Finding | VM | Status |
|---|---|---|---|---|
| H1 | HIGH | 12 credential exports in .bashrc | Galadriel | Remediated |
| H2 | HIGH | openclaw.json world readable (664) | Galadriel | Remediated |
| H3 | HIGH | openclaw.json world readable (644) | Boromir | Remediated |
| H4 | HIGH | AWS Bedrock key exported in .bashrc | Gandalf | Remediated |
| M1–M3 | MEDIUM | Scattered workspace .env files | Gandalf | Open |
| M4 | MEDIUM | Workspace .env with tokens | Boromir | Open |
| Control | Base | Hardened | Hardened v2 | K8s Target |
|---|---|---|---|---|
| Firewall | None | UFW deny all | UFW + iptables logging | NetworkPolicy |
| Credential storage | .bashrc exports | .env (600) | .env (600) | Proxy sidecar |
| Network egress | Unrestricted | Unrestricted | DNS filtering | Per pod allowlist |
| Workload isolation | None | None | Multi user | gVisor sandbox |
| Audit logging | None | None | iptables + VPC Flow | GCP + centralized |
| Prompt integrity | None | None | AGENTS.md rules | Full framework |
| Case Study | Attack Pattern | Defense Layer(s) |
|---|---|---|
| CS#1: Disproportionate Response | Agent destroys own infrastructure | L1 (sandbox limits blast radius) |
| CS#2: Non Owner Compliance | Arbitrary command execution | L1 + L4 (sandbox + stakeholder rules) |
| CS#3: Sensitive Info Disclosure | 124 email records disclosed | L3 + L4 (egress + untrusted labeling) |
| CS#4: Resource Consumption | Infinite loops, persistent processes | L1 (sandbox resource limits) |
| CS#5: Denial of Service | Memory exhaustion via email | L1 (resource quotas) + L3 (egress) |
| CS#6: Provider Value Reflection | API level censorship | Outside scope (model provider issue) |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 508 papers