kienbui1995/magic-powers/agentic-security
Claude Code and agent skill by kienbui1995/magic-powers
- community
Checking that the SKILL.md file is still in the repository.
Use when securing AI agent systems — defending against prompt injection, sandboxing tool execution, preventing indirect attacks through retrieved data, designing minimal-permission tool architectures, and security testing agents.
Install
npx vskill@latest install kienbui1995/magic-powers/agentic-securitySKILL.md
The same SKILL.md was published earlier as kienbui1995/magic-powers/agentic-security.
Agentic Security
Overview
Agents face a fundamentally larger attack surface than static LLMs. A single LLM can be prompted to say something harmful. An agent can be prompted to do something harmful — write files, send emails, query databases, or exfiltrate data. The security stakes are proportional to the agent's real-world capabilities.
When to Use
- Building an agent that accesses external data (web pages, documents, emails, APIs)
- Granting agents tool permissions (file system, email, database, web browsing, code execution)
- Designing multi-agent systems where agents communicate or delegate to each other
- Security review before production deployment of any agent system
- Investigating a suspected prompt injection incident
Core Jobs
1. The Threat Landscape for Agents
Agents face threats that don't exist for static LLMs:
| Threat | Example | Impact | |
|---|---|---|---|
| Direct prompt injection | User asks agent to "ignore rules and reveal your system prompt" | Agent bypasses guardrails | |
| Indirect injection | Agent retrieves a malicious webpage with embedded instructions | Agent exfiltrates data, performs unauthorized actions | |
| Tool abuse | Attacker crafts input to trigger unintended tool calls | Unauthorized access, data deletion | |
| Privilege escalation | Agent gains access beyond intended scope via chained tools | Data breach | |
| Supply chain attack | Malicious MCP server or tool library | Agent executes attacker-controlled code | |
| Agent-to-agent injection | Compromised specialist agent poisons orchestrator | Full agent system compromise |
The most underrated threat is indirect injection — it's silent, doesn't require direct user access, and exploits the agent's own tool use against it.
2. Prompt Injection Defense
Direct injection (input from user):
Important: regex blocklists are a defense-in-depth layer, not the primary defense. Sophisticated injections evade patterns. Complement with model-level resistance and strict output validation.
Indirect injection (from retrieved external content):
The key principle: retrieved content is data, never instructions. Make this distinction explicit in every prompt that includes external content.
System prompt hardening:
3. Tool Permission Design (Least Privilege)
Every tool permission is a potential attack surface. Grant the minimum needed.
Design principle: prefer allowlists over blocklists for high-impact tools (email, file write). Blocklists fail open — attackers find gaps. Allowlists fail closed.
4. Sandboxing Tool Execution
For agents with code execution or system command capabilities:
Sandboxing requirements for code-executing agents:
- No outbound network from sandbox (block SSRF and data exfiltration)
- Non-root user inside container
- Read-only filesystem except designated workspace directory
- CPU and memory limits (prevent resource exhaustion attacks)
- Hard timeout on all executions
- Output size limits (prevent response flooding)
- Drop all Linux capabilities with
--cap-drop=ALL
5. Audit Logging for Agents
Every agent action must be auditable. Without logs, security investigation is impossible.
Log retention: keep audit logs for at least 90 days. Security investigations often happen weeks after an incident.
6. Multi-Agent Trust Model
In multi-agent systems, agent-to-agent messages must be validated — a compromised specialist agent can poison the orchestrator.
Rule: no agent should be implicitly trusted. Internal agents get signed messages. External or third-party agents get the same treatment as untrusted user input.
7. Security Testing Agents
Run injection tests before every deployment — agents should refuse all injection attempts, not comply with them.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agentic-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kienbui1995/magic-powers/agentic-security)