agentleFS
awarexoneawarexone/AXguard/ai-agent-security/SKILL.md

ai-agent-security

Skill18 starsChanged 3 months agoMITView on GitHub

Review AI agents with tools — shell, HTTP, files, browsers — for excessive agency, unsafe exec of model output, and missing human gates (CWE-78 / CWE-94).

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After axguard hits agent.*

    line 40
  2. Very specific:

    Run axguard scan / audit; collect agent.* (and related injection.*, ssrf.*, secrets.*).

    line 63
  3. Distinctive:

    Check allowlists: commands, hosts, paths, HTTP methods.

    line 66
  4. Distinctive:

    Ensure tool credentials are least-privilege and not the developer’s personal cloud keys.

    line 69
  5. Very specific:

    Never exec model output; treat all natural-language “code” as untrusted.

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI Agent Security

Purpose

Assess agents that can act — tool-calling loops with shell, filesystem, network, email, or code execution — focusing on least privilege, approval gates, and never treating model text as trusted code.

When to Use

  • LangChain/LlamaIndex/OpenAI-tools style agents, IDE copilots with terminal, browser agents
  • After axguard hits agent.*
  • Any feature where model output selects or parameterizes privileged actions

When Not to Use

  • Pure chat/RAG without tools (use ai-application-security / prompt-injection)
  • Writing offensive agent jailbreaks or exploit PoCs

Security Concepts

Excessive agency appears when tools are broad (unrestricted shell), credentials are over-scoped, or autonomy lacks human approval for mutate/egress. Prompt injection (direct or via documents/tool output) becomes high impact when tools exist. Executing model output via eval / subprocess / child_process is classic CWE-94 / CWE-78.

Threat Model

Attacker goals:

  1. Coerce the agent to run shell commands or exfiltrate secrets.
  2. Abuse HTTP tools for SSRF into cloud metadata or intranet.
  3. Overwrite files, exfiltrate repos, or send emails as the victim.
  4. Chain tool outputs (indirect injection) to escalate in the next loop turn.

Analysis Workflow

  1. Run axguard scan / audit; collect agent.* (and related injection.*, ssrf.*, secrets.*).
  2. Inventory tools: name, side effects (read/write/egress/exec), argument schema, who can invoke.
  3. Confirm model text never flows into eval, exec, os.system, or shell=True without a hard allowlist intermediary.
  4. Check allowlists: commands, hosts, paths, HTTP methods; deny-by-default.
  5. Require human approval (or strong policy engine) for destructive and egress actions.
  6. Apply prompt-injection to tool descriptions, retrieved docs, and tool results re-entering context.
  7. Ensure tool credentials are least-privilege and not the developer’s personal cloud keys.
  8. Cross-check MCP-exposed tools with mcp-security.

Evidence Requirements

  • Tool registration sites and permission scope
  • Code path from model/tool args → sink
  • Presence or absence of allowlist + approval gate
  • Secret material reachable by tools

False Positive Controls

  • Tools that only call typed internal APIs with server-side authZ independent of the model
  • Dry-run / plan-only agents with no execution backend enabled in prod
  • Shell tool strings that are fully static and unreachable from model args (still prefer removal)

Remediation

  • Replace shell tools with narrow typed actions; sandbox where shell is unavoidable.
  • Structured tool calls + schema validation; reject unknown tools/args.
  • Human-in-the-loop for high impact; session budget limits (steps, tokens, spend).
  • Separate privileges: retrieval identity ≠ mutate identity ≠ egress identity.
  • Never exec model output; treat all natural-language “code” as untrusted.

Verification

Hostile prompt + hostile document tests should fail closed (no shell, no secret egress). Re-run /axguard-agent. Confirm approval gates cannot be skipped via prompt text alone.

Related Skills

prompt-injection, mcp-security, ai-application-security, command-injection, ssrf-analysis, security-remediation

Framework Mapping

  • CWE-78 OS Command Injection
  • CWE-94 Improper Control of Generation of Code ('Code Injection')
  • OWASP A03:2021 Injection; A04:2021 Insecure Design
  • OWASP LLM01:2026 Prompt Injection; LLM03:2026 Excessive Agency
  • MITRE ATLAS AML.T0051

References

Research Provenance

Primary: CWE-78/94; OWASP Top 10:2021 A03/A04; OWASP LLM Top 10:2026 (LLM01/LLM03); ATLAS 2026.08 AML.T0051 (accessed 2026-09-15).
Internal: AXGuard rules/agent.json, /axguard-agent.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.