Security model
How APAI's Capability Passport, scanner, MCP Gateway, and policy packs combine. Zero Trust for AI agents. Threat model. Honest about what each layer catches and what it does not.
The three-layer model
APAI's security story is three layers stacked. Each works on its own; together they provide the full trust contract.
- Verified install: every package has a Capability Passport, a scanner status, and a durable install receipt with the exact rollback command. The Passport is the user-facing contract: what the package CLAIMS it will do.
- Agent discovery: automatic llm.txt manifests at
/packages/{slug}/llms.txtmean any LLM agent can read the install card and apply the package's protocol consistently. Eliminates hallucinated tool behavior. - Governed execution: the MCP Gateway (Phase 6) is the runtime control plane. RBAC, credential injection, audit logging, rate limiting, threat detection. Zero Trust principles applied to agent tool use.
MCP protocol security: what you get for free
The Model Context Protocol provides a baseline:
- Transport security: TLS 1.2+ required for all remote (HTTP/SSE) transports.
- Authorization spec: OAuth 2.1 for HTTP transports.
- No token passthrough: the spec explicitly discourages insecure token forwarding patterns.
What MCP does NOT provide out of the box:
- Built-in RBAC or fine-grained access control.
- Centralized audit logging.
- Authentication for local (stdio) transports - relies on OS process isolation.
Real security in production deployments is implemented at the application and infrastructure layers, primarily through an MCP Gateway.
Key risks in MCP deployments
| Risk | Description | Mitigation |
|---|---|---|
| Credential exposure | Hardcoded or scattered API keys/tokens | Centralized credential injection via Gateway |
| Unauthorized access | Agents calling tools without proper permissions | RBAC + Gateway enforcement |
| Prompt injection | Malicious input via tool responses | Input validation + heuristic scanner (real classifier in Phase 5) |
| Confused deputy | Server acting on behalf of an attacker | Strict authorization + user-context propagation |
| Audit gap | No visibility into tool usage | Centralized logging via Gateway |
| Rate limit abuse | Excessive tool calls inflating cost | Token-based rate limiting at Gateway |
| Supply chain | Unverified third-party MCP servers | Curated registry + Capability Passports + behavioral scanner (Phase 5) |
Zero Trust for AI agents
Zero Trust is built on "never trust, always verify." Applied to AI agents using MCP, it means:
- Every agent request is verified at the Gateway.
- Access is granted on least-privilege principles per agent + tool.
- Continuous monitoring and auditing is enforced.
- System assumes breach: limit blast radius via micro-segmentation.
The MCP Gateway is the enforcement layer. Routing all agent-to-tool traffic through it gives one chokepoint for policy, logging, and revocation.
What the v0.1 scanner actually catches
Be honest: v0.1 scanner is a heuristic stub. It runs two checks:
- Suspicious-pattern regex (13 patterns): rm -rf /, DROP TABLE, curl | sh, powershell -enc, etc.
- Hidden Unicode (Cf general category): catches format characters that can disguise instructions.
Status "heuristic-stub-v0" means: the stub did not flag anything. It does NOT mean the package is certified safe.
Best practices
- Always use the Gateway in production. Local MCP connections are for development.
- Least privilege. Scope tools and permissions aggressively per agent and per workspace.
- Centralize credentials. Never let credentials sit in agent context. Gateway injects at runtime.
- Audit every tool call. Log it. Export to your SIEM.
- Read the Capability Passport. Before you install. Every time.
- Verify the install card checksum. See Honest LLM contract spec when it ships - catches LLMs that lie about which card they loaded.
- Defense in depth. Gateway + Passport review + Policy Pack + behavioral scanner.
Corporate and private deployment
For enterprise and private deployments, additional controls:
- Air-gapped and VPC deployment options for the Gateway.
- Integration with corporate IdPs (Okta, Entra ID, SAML, OIDC).
- Data residency and sovereignty controls.
- Compliance-ready audit trails (SOC 2, GDPR, HIPAA - certifications not yet held, see security page).
- Team and project-based isolation via private registries.
Reporting issues
For security issues, follow the disclosure path at /security. Do not file public GitHub issues for vulnerabilities.