skills/agentic-zero-trust-security/SKILL.md
--- --- license: Apache-2.0 name: agentic-zero-trust-security description: | Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "sec
npx skillsauth add curiositech/windags-skills skills/agentic-zero-trust-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cryptographic security architecture for autonomous AI agent systems. This skill covers the intersection of traditional security engineering and the unique challenges of agents that plan, persist, delegate, and execute across trust boundaries.
Core principle: Never trust, always verify — applied to every agent-to-agent message, every skill loaded, every tool invoked, and every result returned.
Threat Level Assessment:
├── PUBLIC (internet agents, unknown skills)
│ ├── Actions: Full mTLS + JWS + capability tokens + WASM sandbox
│ ├── Audit: Every action logged with Merkle proof
│ └── TTL: Max 5min capability lifetime
├── INTERNAL (trusted agent cluster)
│ ├── Actions: mTLS + JWS + capabilities (longer TTL)
│ ├── Audit: Aggregate logging with daily root publish
│ └── TTL: Max 1hr capability lifetime
└── DEV/TEST (localhost, development)
├── Actions: Optional mTLS + basic capabilities
├── Audit: Local file logs (no Merkle tree)
└── TTL: Max 24hr capability lifetime
Incoming Agent Request Processing:
├── 1. Verify mTLS certificate chain
│ ├── Valid CA signature? → Continue
│ └── Invalid/expired? → REJECT immediately
├── 2. Parse JWS message envelope
│ ├── Signature valid + not expired? → Continue
│ ├── Replay detected (jti cache)? → REJECT
│ └── Signature invalid? → REJECT + log security event
├── 3. Check required capabilities
│ ├── Agent holds exact capability? → GRANT
│ ├── Agent holds broader capability? → ATTENUATE + GRANT
│ ├── Capability expired? → REJECT + force refresh
│ └── No matching capability? → REJECT + suggest minimal grant
└── 4. Execute with sandbox constraints
├── WASM skills: CPU/memory limits enforced
├── File operations: Path validation against capabilities
└── Network calls: Destination validation against capabilities
Capability Delegation Request:
├── Parent capability delegatable=true?
│ ├── Yes → Check remaining depth
│ │ ├── Depth > 0 → Allow with depth-1
│ │ └── Depth = 0 → REJECT (max delegation reached)
│ └── No → REJECT (not delegatable)
├── Requested actions ⊆ parent actions?
│ ├── Yes → Allow subset
│ └── No → REJECT (cannot escalate privileges)
└── Trust boundary crossed?
├── Same orchestrator domain → Allow
└── Different domain → Require explicit cross-domain capability
Detection: grep -r "process.env" agent_code/ shows environment variable access without capability check
Symptom: Agent accesses resources it shouldn't have permissions for
Fix: Replace with explicit capability tokens scoped to exact resources needed
Detection: Multiple audit log entries with identical jti (message ID) or timestamps within replay window
Symptom: Agent receives and processes the same command multiple times
Fix: Implement jti deduplication cache with TTL matching message expiry
Detection: Child capability has more actions than parent, or delegation depth exceeded configured maximum Symptom: Sub-agents gain more privileges than their parent delegator intended Fix: Enforce attenuation invariant: child capabilities ⊆ parent capabilities at delegation time
Detection: Agent CPU usage >95% for >30 seconds, or memory usage approaching sandbox limits Symptom: Agent attempts infinite loops or excessive memory allocation to break out of constraints Fix: Hard-kill agent process at resource limits, implement fuel-based execution metering
Detection: Agent accepts certificate without CA verification on first connection Symptom: Man-in-the-middle attacks succeed by presenting any certificate Fix: Pre-provision all agent certificates, maintain explicit trust store, reject unknown CAs
Scenario: Research agent needs to pass analysis to code generation agent, then to review agent.
Setup Phase:
// Orchestrator mints capabilities
const researchCap = mint.mint('fs:/tmp/research/**', ['read','write'], 'agent-research-001');
const codegenCap = mint.mint('fs:/workspace/src/**', ['read','write'], 'agent-codegen-001');
const reviewCap = mint.mint('fs:/workspace/**', ['read'], 'agent-review-001');
Message Flow:
Research → Codegen: Research agent creates JWS-signed message:
Header: {alg: 'EdDSA', kid: 'agent-research-001/v1'}
Payload: {
iss: 'agent-research-001',
sub: 'agent-codegen-001',
dag_id: 'proj-alpha-v1',
action: 'task',
body: {analysis: "API needs OAuth2 flow", output_path: "/tmp/research/api_analysis.json"}
}
Codegen Verification: Codegen agent receives message:
Codegen → Review: Codegen creates signed result:
{
"iss": "agent-codegen-001",
"sub": "agent-review-001",
"action": "result",
"body": {"generated_files": ["/workspace/src/auth.ts"], "confidence": 0.87}
}
Novice miss: Would skip jti replay protection, allowing duplicate processing. Expert insight: Audit trail shows complete message chain with cryptographic proof of custody.
Scenario: Main agent needs to delegate file analysis to specialized sub-agent, but restrict access to sensitive directories.
Initial Grant:
// Orchestrator grants broad filesystem access
const mainCap = mint.mint('fs:/project/**', ['read','write','execute'], 'agent-main', {
delegatable: true,
maxDepth: 2,
ttlSeconds: 3600
});
Attenuation Decision Tree:
Main agent evaluating delegation request:
├── Sub-agent requests: fs:/project/src/** [read]
│ ├── /project/src/** ⊂ /project/** ? YES
│ ├── [read] ⊂ [read,write,execute] ? YES
│ ├── Delegation depth 2 > 0 ? YES
│ └── GRANT: Create attenuated capability
├── Sub-agent requests: fs:/project/secrets/** [read]
│ ├── Path contains "secrets" → Security policy violation
│ └── REJECT: Sensitive path exclusion
└── Sub-agent requests: fs:/etc/passwd [read]
├── /etc/passwd ⊂ /project/** ? NO
└── REJECT: Outside authorized scope
Attenuated Capability Generated:
const subCap = mint.attenuate(mainCap, 'agent-analyzer-001', ['read']);
// Results in: fs:/project/src/** [read] delegatable=true maxDepth=1 ttl=3600s
Novice miss: Would grant full parent capability without restriction. Expert insight: Attenuation enforces "never escalate privileges" at the cryptographic level.
Scenario: Code generation agent attempts to access network during execution, violating sandbox policy.
Sandbox Configuration:
const codegenSandbox = {
fileRead: ['/workspace/src/**', '/workspace/package.json'],
fileWrite: ['/workspace/src/**'],
netConnect: false, // NO network access
maxExecutionMs: 300000,
maxMemoryMb: 512
};
Violation Detection Flow:
Agent Action: Codegen attempts fetch('https://api.github.com/repos/...')
Sandbox Intercept: WASM runtime catches syscall for network socket
Policy Check: netConnect: false → VIOLATION DETECTED
Trade-off Analysis:
Security vs Functionality Trade-offs:
├── STRICT (current): Block network, terminate agent
│ ├── Pro: Zero network attack surface
│ ├── Con: Cannot fetch external dependencies/docs
│ └── Decision: ENFORCE (security-first environment)
├── MODERATE: Allow specific whitelisted domains
│ ├── Pro: Functional for known-good APIs
│ ├── Con: DNS poisoning, subdomain takeover risks
│ └── Decision: Consider for dev environments only
└── PERMISSIVE: Log but allow
├── Pro: Full functionality preserved
├── Con: Agent can exfiltrate data, download malware
└── Decision: REJECT (violates zero-trust model)
Response: Terminate agent, log security event:
{
"event": "sandbox_violation",
"agent_id": "agent-codegen-001",
"violation_type": "unauthorized_network_access",
"attempted_url": "api.github.com",
"policy_matched": "netConnect: false",
"action_taken": "terminate_agent"
}
Novice miss: Would allow the network access "just this once" or not detect the violation. Expert insight: Sandbox violations indicate potential compromise or model drift—always enforce strictly.
This skill should NOT be used for:
security-auditor insteadinfrastructure-engineer insteadprompt-engineer skill insteaddevops-automator skill insteadDelegation boundaries:
security-auditorinfrastructure-engineersoftware-engineersecurity-incident-responsetools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.