agent-security-hardeningcommit 9e951e2SKILL.md · Hardening
Agent Security Hardening
Hardens the boundaries where an agent turns untrusted data into filesystem, network, memory or tool actions, producing concrete controls and tests.
npx skills add affaan-m/ECC --skill agent-security-hardeningCommand selected. Copy it manually.
- Permissions
- read-repo
- write-files
- shell
- network
- Compatible with
- Claude Code, Codex, Cursor, Copilot, OpenCode
- GitHub
- 294.3k
- Source
- Community · Affaan Mustafa
- Status
- Scan passed
- License
- MIT
- Category
- Hardening
Core rule
Treat model output, retrieved content, tool output, memory and cross-agent messages as untrusted input.
Execution Phases
Phase 01Map trust boundaries
List every boundary as source -> parser -> validator -> side effect, recording the authorizing identity, validator, size limits, audit evidence and recovery path.
Phase 02Validate IDs, env and URLs
Allowlist identifiers and reject empty env values; parse URLs, block private destinations, and stop DNS rebinding and cross-origin credential forwarding.
Phase 03Contain filesystem access
Reject absolute paths, traversal and Windows-unsafe components, prove the resolved path stays in the workspace, and handle symlink races separately.
Phase 04Protect secrets and output
Create sensitive temp files owner-only and keep secrets out of arguments, logs and model context; read tool output with a byte limit and return typed failures.
Phase 05Verification gate
Verify six behaviors through the real entry point and report the command, exit status, rejected input and the observed absence of side effects.
Permissions (summarised from SKILL.md)
| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Writes validation, containment and other control code plus tests for the framework under review. |
| Command execution | Tests only | Runs tests through the real entry point to prove the hardened behavior and reports commands and exit status. |
| Network outbound | Not required | The skill itself makes no network calls; the network topics are outbound controls to be hardened. |
SKILL.md frontmatter (YAML)
---
name: agent-security-hardening
description: Security hardening guidance for AI agent frameworks that process untrusted content, invoke tools, write workspace files, manage runtime identifiers, or handle credentials. Use when building or reviewing an agent runtime, autonomous worker, tool gateway, memory service, or multi-tenant agent deployment. Do not use for general web application security or offensive testing.
metadata:
origin: ECC
---