剑庭安
首页
黑客安全首页全部安全栏目 黑客技术黑客技术、渗透测试、漏洞利用工具与教程 安全软件安全工具、扫描器、检测与审计软件 病毒分析恶意软件分析、样本、逆向与沙箱 CTF思路CTF 题目、writeup、解题思路与工具 防护思路防御技术、加固、检测响应与蓝队 红蓝攻防红队攻击模拟、蓝队对抗、攻防演练 漏洞知识库漏洞、CVE、PoC、EXP 与安全研究
逆向|反编译
PHP源码PHP 网站源码、程序、系统 APP源码安卓/iOS APP 源码 ASP源码ASP 网站源码与程序 NET源码.NET 网站源码与系统 小程序源码微信/支付宝小程序源码 Dedecms风格模板Dedecms 织梦风格模板 Empirecms风格模板EmpireCMS 帝国风格模板 Discuz商业模板/插件Discuz 商业模板与插件 WordPress主题/插件WordPress 主题与插件 其它源码、模板其它各类源码与模板 游戏源码游戏源码与引擎项目 加密货币源码加密货币、区块链、钱包、USDT/比特币相关源码与工具 手游源码手机游戏源码、服务端、客户端与引擎项目 传奇源码热血传奇、传奇世界、复古传奇等客户端/服务端/引擎源码 页游源码网页游戏、H5 游戏、浏览器游戏源码 端游源码电脑单机游戏、PC 网游客户端/服务端源码
最新万能免驱动支持所有型号打印机下载程序 日历天气老黄历 · 每天同步真实日期与天气
站长工具站长工具 自助开通会员浏览该分类 其他资源qtziy SEO工具SEO工具 站群源码站群源码 泛程序泛程序 蜘蛛模板蜘蛛模板 蜘蛛池蜘蛛池 外链工具外链工具
搜索 自助开通会员🔓 破甲 API
登录 注册
首页 分类列表 安全软件 agentshield - AI agent secur…
agentshield - AI agent security scanner. Detect vulnerabilities 安全软件 点击放大
作者:admin 发布:2026-10-05

agentshield - AI agent security scanner. Detect vulnerabilities

项目说明<di="center"><img src="./assets/agentshield-logo.png" alt="AgentShield" width="180" />AgentShi…
资源可下载 免费下载 0 条讨论
会员资源
开通会员后即可下载全部资源。
登录后开通会员
会员方案
248浏览量
0讨论
2下载链接
可下载资源状态
内容可验证
更新 2026-10-05
人工审核发布
评论区答疑

agentshield - AI agent security scanner. Detect vulnerabilities

项目说明

<di="center">

<img src="./assets/agentshield-logo.png" alt="AgentShield" width="180" />

AgentShield

Security auditor for AI agent configurations

Scans Claude Code setups for hardcoded secrets, permission misconfigs,<br/>
hook injection, MCP ser, and agent prompt injection .<br/>
A as CLI, GitHub Action, and GitHub App integration.

![npm ]()
![npm downloads]()
![tests]()
![co]()
![License: MIT](LICENSE)

Quick Start · What It Catches · API Reference · Opus Pipeline · GitHub Action · Distribution · MiniClaw · Changelog

<a href="
<img src="./assets/ito.svg" alt="Itô Markets" width="180" />
</a>
<br />
<sub><strong>Preferred compute sponsor:</strong> Run or self-host any open-source model. Itô is ECC's suggested compute provider. Any GPU provider works. ECC only links to the Itô dashboard for sign-in and GPU rental or management; it does not create or manage rentals or pro compute or serving. Managed inference through Itô is not live yet.</sub>

</div>

---

Why

The AI agent ecosystem is growing faster than its security tooling. In January 2026 alone:

  • 12% of a major agent skill marketplace was malicious (341 of 2,857 community skills)

  • A CVSS 8.8 C 17,500+ internet-facing instances to one-click RCE

  • The Moltbook breach compromised 1.5M API tokens across 770,000 agents
  • De install community skills, connect MCP servers, and configure hooks without any automated way to audit the security of their setup. AgentShield scans your .claude/ directory and flags before they become exploits.

    Built at the Claude Code Hackathon (Cerebral x Anthropic, Feb 2026). Part of the E Claude Code ecosystem (42K+ stars).

    Quick Start

    That's it. AgentShield auto-discovers your ~/.claude/ directory, scans all config files, and prints a graded security report.

    Discovery intentionally skips common generated directories such as node_modules, build output, and .dmux worktree mirrors so transient copies do not duplicate findings.

    More commands

    JSON reports now expose findings[].runtimeConfidence when AgentShield can distinguish acti config from project-local settings, template/example in, installed Claude plugin caches, declarati manifests, and manifest-resol hook implementations. Reports also include local harness adapter e for Claude Code, OpenCode, Codex, Gemini, Zed, VS Code, dmux, terminal-agent wrappers, and project-local templates when matching markers are present.

    What It Catches

    268 rules across 15 modules, graded A to F with a 0 to 100 numeric score. Recognized defenses are listed and ne.

    #### Scoring and recognized defenses

    The score starts at 100 per category and only findings deduct from it: critical 25, high 15, medium 5, low 2, info 0. Protecti the scanner finds (deny and ask lists, sandbox settings, blocking PreToolUse hooks, read-only agent tool lists, Codex sandbox_mode, Hermes manual approvals, and similar) is listed in every report under "Recognized Defenses" so it gets credit and is ne. Defenses do not add points either: the score cannot be gamed by adding decorative deny rules, it can only be lowered by real findings. Guard-pattern findings the permission rules emit at info se ("Deny/ask rule blocking ...", "Prohibition of ...", "Mention of ...") are enforced to a zero deduction in src/reporter/score.ts.

    Secrets Detection

    | What | Examples |
    |------|----------|
    | API keys | Anthropic (sk-ant-), OpenAI (sk-proj-/sk-), xAI (xai-), AWS (AKIA), Google/Gemini (AIza), Stripe (sk_test_/sk_live_) |
    | Tokens | GitHub PATs (ghp_/github_pat_), Linear (lin_api_), Cloudflare (CF_API_TOKEN=), Slack (xox[bprs]-), JWTs (eyJ...), Bearer tokens |
    | Credentials | Hardcoded passwords, database connection strings (postgres/mongo/mysql/redis), private key material |
    | En | Secrets passed through en in configs, echo $SECRET in hooks |

    Permission Audit (17 rules)

    | What | Examples |
    |------|----------|
    | Wildcard access | Bash(*), Write(*), Edit(*) — unrestricted tool permissions |
    | Missing deny lists | No deny rules for rm -rf, sudo, chmod 777 |
    | Dangerous flags | --dangerously-skip-permissions usage |
    | Mutable tool exposure | All mutable tools (Write, Edit, Bash) allowed without scoping |
    | Destructive git | git push --force, git reset --hard in allowed commands |
    | Unrestricted network | curl *, wget, ssh *, scp * in allow list without scope |

    Hook Analysis (40 rules)

    | What | Examples |
    |------|----------|
    | Command injection | ${file} interpolation in shell commands — attacker-controlled filenames become code |
    | Data exfiltration | curl -X POST with interpolation sending data to external URLs |
    | Silent errors | 2>/dev/null, \|\| true — failing security hooks that silently pass |
    | Missing hooks | No PreToolUse hooks, no Stop hooks for session-end |
    | Network exposure | Unthrottled network requests in hooks, sensitive file access without filtering |
    | Session startup | SessionStart hooks that download and execute remote scripts |
    | Package installs | Global npm install -g, pip install, gem install, cargo install in hooks |
    | Container escape | Docker --pri, --pid=host, --network=host, root mounts |
    | Credential access | macOS Keychain, GNOME Keyring, /etc/shadow reads |
    | Reverse shells | /dev/tcp, mkfifo + nc, Python/Perl socket shells |
    | Clipboard access | pbcopy, xclip, xsel, wl-copy — exfiltration |
    | Log tampering | journalctl --, rm /var/log, history -c — anti-forensics |

    MCP Ser (49 rules)

    | What | Examples |
    |------|----------|
    | High-risk servers | Shell/command MCPs, filesystem with root access, database MCPs, browser automation |
    | Supply chain | npx -y auto-install without confirmation — typosquatting |
    | Hardcoded secrets | API tokens in MCP en config instead of env |
    | Remote transport | MCP servers connecting to remote URLs (SSE/streamable HTTP) |
    | Shell metacharacters | &&, \|, ; in MCP ser arguments |
    | Missing metadata | No pin, no description, excessi count |
    | Sensitive file args | .env, .pem, credentials.json passed as ser |
    | Network exposure | Binding to 0.0.0.0 instead of localhost |
    | Auto-approve | autoApprove settings that skip user confirmation for tool calls |
    | Missing timeouts | High-risk servers without timeout — resource exhaustion risk |

    Supply-chain (agentshield scan --supply-chain) extracts MCP
    package references plus root package.json and package-lock.json dependency
    e, then reports pro counts for npm vs git, pinned ,
    known-good packages, and npm-registry-backed metadata. Add
    --supply-chain-online to query npm for downloads, maintainers, postinstall
    scripts, deprecation, and package age.

    Package-manager hardening checks also scan .npmrc, .yarnrc.yml, and
    pnpm-workspace.yaml for plaintext registry credentials, explicit dependency
    lifecycle-script enablement, and missing or weak release-age cooldowns where the
    package manager supports them. npm configs are checked for lifecycle-script
    blocking and unsupported release-age keys that can create false confidence; use
    pnpm minimumReleaseAge / minimum-release-age, Yarn npmMinimalAgeGate, or an
    external package-manager policy wrapper for cooldown enforcement.

    AgentShield also scans AI de persistence surfaces used by recent npm
    and PyPI campaign payloads, including Claude Code hook settings,
    .claude/router_runtime.js, VS Code tasks.json folder-open automation,
    Zed project tasks.json, ./setup.mjs, .zed/setup.mjs, GitHub
    workflow drop-ins, LaunchAgent/systemd dead-man switch artifacts,
    gh-token-monitor token-store files, metadata-service credential targets, and
    reported exfiltration or second-stage network indicators. These indicators are
    emitted as critical hook findings so CI can fail fast e the malicious
    package has been uninstalled.

    #### MCP Confidence Notes

    AgentShield scans both active MCP config and repository-shipped MCP templates.

  • Findings from .mcp.json, mcp.json, .claude/mcp.json, .claude.json, and active settings.json are highest-confidence runtime exposure only under acti configuration roots; copies in docs, examples, or template directories are classified separately.

  • Findings from settings.local.json are emitted as runtimeConfidence: project-local-optional.

  • Findings from locations such as mcp-configs/, config/mcp/, or configs/mcp/ indicate risky MCP definitions present in repository templates, not guaranteed acti enablement.

  • JSON, markdown, terminal, and HTML outputs now expose source context via runtimeConfidence: acti | project-local-optional | template-example | docs-example | plugin-cache | plugin-manifest | hook-code.

  • Non-secret template-example MCP findings are score-weighted at 0.25x, and one template file is capped at 10 deduction points per score category so a single MCP catalog cannot score like dozens of enabled servers.

  • In template files, findings such as risky server type, remote URL transport, npx -y, unpinned packages, and en inheritance are still , but they should be interpreted as "this repo ships a risky MCP template" rather than "this MCP is definitely enabled right now."

  • Aggregate findings like large MCP ser are especially likely to o runtime exposure when the source file is a template catalog.
  • Agent Config Review (41 rules)

    | What | Examples |
    |------|----------|
    | Unrestricted tools | Agents with Bash access, no allowedTools restriction |
    | Prompt injection surface | Agents processing external/user-provided content without defenses |
    | Auto-run instructions | CLAUDE.md containing "Always run", "without asking", "automatically install" |
    | Hidden instructions | Unicode zero-width characters, HTML comments, base64-encoded directives |
    | URL execution | CLAUDE.md instructing agents to fetch and execute remote URLs |
    | Time bombs | Delayed execution instructions triggered by time or absence conditions |
    | Data har | Bulk collection of passwords, credentials, or database dumps |
    | Prompt reflection | ignore previous instructions, you are now, DAN jailbreak, fake system prompts |
    | Output manipulation | always report ok, remo from output, suppress security findings |

    Structured JSON under .claude/subagents/ and .claude/slash-commands/ is analyzed like agent config when it declares allowedTools or similar tool metadata. Slash commands under commands/ and slash-commands/ are typed command-md: they get the injection and dangerous-instruction rules but not the skill packaging hygiene rules, which only apply to SKILL.md. Freeform skill-md prompt text still has narrower security co than agent-md and CLAUDE.md.

    #### Scanner Accuracy Notes

  • Li notes and follow-up items are tracked in false-positi.md.

  • The most useful operator guidance is in the audit's Triage Rules For Current Reports section.

  • The audit doc also includes a reusable False-Positi, Repo Audit Worksheet, and Release Gate For Accuracy Changes.

  • Cross-file hook-manifest awareness now suppresses settings-only hooks-no-pretooluse when a companion hooks/hooks.json manifest defines PreToolUse hooks.

  • Manifest-referenced hook implementations are now discovered from hooks/hooks.json-style indirection; shell targets continue through hook rules, and non-shell hook-code targets now emit targeted findings for explicit output(...) context injection, transcript input access, and remote shell payloads executed wrappers.

  • Current known high-signal caveats are broader non-shell hook execution that still needs language-aware analysis beyond those current hook-code signals, and skill-md prompt text that still bypasses most agent/injection rules.

  • runtimeConfidence now appears on MCP findings, settings.local.json, docs/examples, installed Claude plugin caches, plugin manifests, and manifest-resol hook code. Scoring discounts non-secret template-example and docs-example findings at 0.25x, non-secret project-local-optional findings at 0.75x, and non-secret plugin-cache / plugin-manifest findings at 0.5x. Non-secret template-example findings are also capped at 10 deduction points per file and score category so one catalog file cannot dominate the grade. hook-code findings currently stay at full weight, but the acti there are narrow language-aware implementation signals.

  • Practical reading rule: template-example means "repo ships this risky template", not "this is definitely enabled right now."

  • Practical reading rule: docs-example means "repo ships risky sample guidance", not "this example is acti config."

  • Practical reading rule: plugin-cache means "installed plugin content is present on disk", not "this file is top-le config"; real secrets still stay critical.

  • Practical reading rule: plugin-manifest means "the repo declares this hook behavior", while hook-code means "the scanner reached the referenced non-shell implementation."

  • Current edge case: docs-only example trees now re-add the standalone CLAUDE.md example file for scanning, but still suppress the rest of the nested example subtree unless a runtime companion exists.

  • Current edge case: tutorial/example bundles outside the current docs/, commands/, examples/, samples/, demo/, tutorial/, guide/, cookbook/, and playground/ heuristics can still be treated as li until broader example-root classification lands.

  • Docs-only nested CLAUDE.md roots under docs/ are now skipped unless runtime config companions exist in the same subtree.

  • Exact Bash(curl ) and Bash(wget ) allow entries with pinned literal URLs no longer trigger the generic permissions-permissive-* finding; wildcard and dynamic network permissions still do.

  • Exact Bash(node scripts/foo.js ...) and Bash(python3 ./tools/audit.py ...) wrapper commands no longer trigger the generic interpreter-access finding; inline e such as node -e and python -c still do.

  • Exact read-only Docker in commands such as Bash(docker ps) and Bash(docker image ls) no longer trigger the generic Docker-access finding; execution-oriented forms such as docker run and docker exec still do.

  • Exact settings.local.json allowlists now downgrade permissions-no-deny-list from high to medium when every allow entry is fully specified; wildcard or dynamic project-local permissions still keep the higher se.

  • Exact local-only settings.local.json allowlists now also downgrade hooks-no-pretooluse from medium to low; broader or network-capable project-local configs still keep the higher se.

  • Comment-only shell-hook lines are now ignored by the hook exfiltration, sensiti, and silent-fail regex rules, so inline remediation notes and commented examples no longer look like live hook behavior.

  • Narrow specialist agents, subagents, and slash commands now downgrade generic Bash-access and escalation-chain findings from high to medium; broader generalist workflows still keep the higher se.

  • Repo-scoped filesystem MCP servers using relati like ./ now grade lower than unrestricted root/home filesystem access; root-le exposure still stays high.

  • Defensi content that mentions patterns like `fetch(userPro) no longer triggers agents-injection-surface; direct instructions to fetch/process external content still do.

  • agents-explorer-write now uses role metadata and the lead agent intro instead of any later workflow/example text, so procedural search for ... steps in normal worker prompts no longer get mislabeled as explorer-style agents. Example: chief-of-staff.md no longer trips that rule just because it contains gog gmail search ....

  • agents-o now measures effecti size instead of raw file length, discounting fenced code blocks and Markdown tables. Example-hea like chief-of-staff.md and planner.md no longer trip the rule, while prose-hea still do.

  • Markdown example/test passwords in example-like paths such as docs/, commands/, examples/, tutorials/, and demos/ are now suppressed when the surrounding context is clearly instructional; that suppression does not apply to normal agent/config markdown.
  • #### False-Positi Workflow

    Use this workflow when a repo scan looks noisy or when you are tuning AgentShield rules.

    1. Start with JSON output so you can inspect file paths, runtimeConfidence, and score impact directly.
    2. Separate acti findings from lower-confidence source kinds before changing any rules.
    3. suspected false positi at least one real repo and one minimal synthetic fixture.
    4. Prefer source-aware reclassification and wording changes before adding blanket suppression.
    5. Keep real secrets and explicit execution paths e examples, manifests, or templates.
    6. Re-run targeted tests, then the full gate, before changing release behavior.

    Recommended commands:

    Confidence-first triage commands:

    Recommended audit order:

  • acti and project-local-optional: treat as highest-signal findings first.

  • template-example, docs-example, and plugin-cache: confirm whether the repo or installed plugin cache is shipping risky guidance actually enabling it.

  • plugin-manifest: confirm whether the risk is in declarative hook wiring or the referenced implementation.

  • hook-code: confirm whether the implementation actually injects context, reads transcripts, or shells out in a risky way.
  • Rule-design guidelines:

  • Prefer source-aware labeling o. If a finding is real but lower confidence, keep it and say why.

  • Prefer cross-file context o guesses. Companion manifests and referenced hook implementations usually matter more than isolated config.

  • Prefer narrow, beha hook-code rules o wrapper heuristics. spawnSync("bash", ["-lc", "curl ... | bash"]) is high-signal; ordinary spawnSync("prettier", ...) is not.

  • Do not downgrade real secrets just because they appear in docs or examples. Structural findings can be downgraded; committed credentials should stay critical.

  • Keep example-root heuristics e. Today the scanner treats docs/, commands/, examples/, example/, samples/, sample/, demo/, demos/, tutorial/, tutorials/, guide/, guides/, cookbook/, and playground/ as example-like paths.
  • When you change rule accuracy, update both:

  • false-positi.md with the new baseline and remaining gaps

  • the targeted regression tests for the specific rule family you changed

  • agentshield scan --corpus-gate in CI so the built-in attack corpus must stay fully detected; failed corpus gates now include a prioritized accuracy impro plan by category, missing rule, and missed config

  • the corpus now includes an en/DNS exfiltration fixture so proxy hijack, runtime import mutation, en exfiltration, credential-store access, and clipboard access stay covered together

  • if you are filing a scanner-noise bug, start from the audit doc's False-Positi Template
  • #### Reducing False Positives In Practice

    The current scan profile is not dominated by broken matchers. It is mostly dominated by lower-confidence source kinds that need different interpretation.

    Current patterns from the latest li:

  • template MCP in is still the biggest noise source by count in e

  • example/tutorial config needs example-aware wording and weighting, not blanket suppression

  • declarative hook manifests and executable hook implementations need different handling

  • many remaining agent findings are policy findings about intentionally pri agents, not obvious rule bugs

  • the latest alert review reduced specialist agent-capability se inflation, repo-scoped filesystem MCP inflation, and template-catalog score inflation; remaining noise is now mostly template count/interpretation and acti remote MCP URLs
  • Recurring pattern signatures to recognize:

  • one template file dominating the report usually means confidence/weighting work, not a broken matcher

  • broad agents-* clusters across files with explicit tool metadata usually mean policy review, not false-positi

  • very small project-local-optional clusters usually mean scope is already modeled and only se may need tuning

  • a repo-scoped filesystem MCP with relati args should not be treated like root/home filesystem access
  • When to open a false-positi instead of just triaging the report:

  • the same finding pattern reproduces across at least one real repo and one minimal synthetic fixture

  • the finding is wrong for its own source kind, not just lower-confidence than acti

  • the fix needs matcher changes, not just better wording, score weighting, or cross-file context

  • the finding would still be misleading e reading runtimeConfidence
  • Recommended operating model:

  • Start with runtimeConfidence before changing any rule. Separate acti from template-example, docs-example, plugin-cache, plugin-manifest, and project-local-optional.

  • Reclassify before suppressing. If the finding is real but lower confidence, keep it and adjust wording or score weight instead of hiding it.

  • Keep secrets on a stricter standard. Real credentials should stay critical even in docs, examples, plugin caches, or manifests.

  • Use cross-file context whene. Settings, manifests, and referenced hook implementations usually need to be read together.

  • For hook-code, add only narrow language-aware rules for explicit risky behavior. Avoid broad wrapper heuristics.

  • For agent rules, anchor on role metadata and lead instructions before matching arbitrary later prose.
  • Repo con that help AgentShield scan accurately:

  • put reusable MCP catalogs under template paths such as mcp-configs/ instead of li config files

  • keep local-only o in settings.local.json

  • keep tutorials and examples under example-like paths such as docs/, examples/, tutorials/, demos/, or guides/

  • keep hooks/hooks.json declarative and put the implementation in separate hook script files

  • keep large agent examples inside fenced code blocks so prompt-size and role heuristics stay accurate
  • Current high-value places to audit first:

  • files with the highest finding count

  • files with runtimeConfidence: template-example or plugin-cache

  • settings.local.json findings that may be project-local rather than repo-wide

  • plugin-manifest findings that need confirmation in the referenced implementation

  • hook-code findings that invol injection, transcript access, or child-process execution
  • Features

    Auto-Fix Engine (--fix)

    Automatically applies safe fixes:

  • Replaces hardcoded secrets with ${ENV_VAR} references

  • Tightens wildcard permissions (Bash(*) → scoped Bash(git *), Bash(npm *))
  • Only fixes marked auto: true are applied. Permission changes require human review.

    : --fix does not trust itself. After applying fixes it re-scans the target, and if the posture score regressed or a new high/critical finding appeared (the kind of churn a nai tighten can cause), it rolls every modified file back to its original content. On success it prints a tamper-e attestation digest binding the before/after score and finding deltas, so the kept fixes are provably non-regressing.

    External Rule Packs (--rule-pack)

    Run community or private detection rules alongside the built-ins, without recompiling:

    A pack is a JSON file with the same fail-closed approach as --policy (bad JSON, schema , duplicate ids, or an uncompilable regex abort the scan):

    Each pattern is a JS regex run against file content; fileTypes is optional and scopes a rule to specific config types. External findings count toward the o grade. Anyone with a pack in this shape can plug in.

    Secure Init (agentshield init)

    Generates a hardened .claude/ directory with scoped permissions, safety hooks, and security best practices. Existing files are ne.

    Claude Opus Deep Analysis (--opus)

    Three-agent ad pipeline powered by Claude Opus (claude-opus-5 by default; the injection tester uses claude-sonnet-5):

    1. Red Team (Attacker) — finds exploitable attack and multi-step chains
    2. Blue Team (Defender) — e existing protections and recommends hardening
    3. Auditor — synthesizes both perspectives into a prioritized risk assessment

    The Attacker finds that curl hooks with ${file} interpolation + Bash(*) = command injection pivot. The Defender notes no PreToolUse hooks exist to stop it. The Auditor chains them into a prioritized action list.

    Requires ANTHROPIC_API_KEY en .

    #### OrcaRouter provider

    The --opus and --injection analysis modes can also run through
    OrcaRouter, an OpenAI/Anthropic-compatible gateway
    that routes each request to the most cost-effecti model:

    The provider points the Anthropic client at and
    uses the gateway's namespaced model ids (e.g.
    anthropic/claude-sonnet-5,
    anthropic/claude-opus-5). The default provider remains Anthropic.

    With --provider orcarouter the scanned configuration contents are sent to
    OrcaRouter's API instead of Anthropic's, so do not use it on configs containing
    secrets you have not redacted.

    Compliance Mapping (--compliance)

    Map findings to audit-framework control IDs so GRC teams get an auditor-ready co artifact instead of a raw findings list:

    Each framework prints a control-co table (control id, title, highest se, finding count, examples), ordered by se:

    Mapping is finding-category-le (SOC 2, PCI DSS v4.0, ISO/IEC 27001:2022 Annex A), not a certified crosswalk; confirm control applicability with your auditor.

    Output Formats

    | Format | Flag | Use Case |
    |--------|------|----------|
    | Terminal |
    --format terminal (default) | Interactive use |
    | JSON |
    --format json | CI pipelines, programmatic access |
    | Markdown |
    --format markdown | Documentation, PRs |
    | HTML |
    --format html | Executi with risk posture and priorities |
    | E pack |
    --e <dir> | Audit and buyer reviews |
    | Remediation plan |
    --remediation-plan <path> | Stable-fingerprint fix queue for CI and ticketing |

    E packs write a deterministic directory containing manifest.json,
    README.md, agentshield-report.json, agentshield-report.html,
    agentshield-results.sarif, policy-e.json,
    baseline-comparison.json, supply-chain.json, and
    ci-context.json, and remediation-plan.json. The manifest records SHA-256
    digests and byte counts for bundle artifacts plus a bundle digest over the
    machine-readable e.
    ci-context.json records whitelisted GitHub Actions
    workflow, commit, run, and runner pro without copying arbitrary
    en into the bundle.
    Redaction is enabled by default for local paths, usernames, emails, and
    token-shaped strings; use
    --no-e only for private internal
    bundles.

    Remediation plans write a JSON queue of findings with stable hashed
    fingerprints, se, file, fixability, ordered workflow phases, and the
    recommended next command. The workflow phases route safe auto-fixes first,
    manual-review findings second, and last so maintainers can attach
    the plan to CI tickets without turning every finding into a separate thread.
    They intentionally omit raw e and fix before/after so teams can
    attach the plan to tickets without copying token-shaped strings.

    a sa pack before attaching it to CI artifacts or customer
    handoffs:

    Inspect a e pack when a downstream GitHub App, Linear sync, or
    security-review workflow needs a compact readback without opening every artifact:

    Aggregate multiple e packs when an operator needs fleet-level
    routing across repos, teams, or harnesses. The JSON output includes
    operatorReadback for promotion status/digest checks and re with
    source e paths and owner-ready recommendations for packs that need
    follow-up:

    operatorReadback is the stable field for downstream GitHub App, Linear, or
    ECC Tools routing. It reports
    ready, status, digest, owner counts,
    blocking review counts, appro, deterministic
    appro, and the
    next operator action so fleet promotion can be gated without parsing terminal
    prose. Each review item also carries the same
    approvalId plus a
    Linear-friendly ticket
    externalId, allowing sync jobs to dedupe owner approval
    threads across reruns.

    JSON Report Shape

    agentshield scan --format json is the supported machine-readable scanner interface today.

    Notes:

  • runtimeConfidence is emitted for acti config, settings.local.json, docs/examples, installed Claude plugin caches, plugin manifests, and manifest-resol hook code.

  • harnessAdapters is local marker e only. It does not call external services or imply a hosted/team entitlement.

  • Adapter confidence is strong when a primary harness marker exists, and partial when only supporting directories or secondary markers are present.

  • acti means acti such as .mcp.json, mcp.json, .claude/mcp.json, .claude.json, or active settings.json.

  • project-local-optional means project-local settings such as settings.local.json.

  • template-example means template/catalog files such as mcp-configs/ or config/mcp/.

  • docs-example means docs/tutorial/example content such as docs/guide/settings.json or commands/*.md.

  • plugin-cache means installed Claude plugin cache content such as .claude/plugins/cache/....

  • plugin-manifest means declarative hook manifests such as hooks/hooks.json.

  • hook-code means a manifest-resol implementation such as scripts/hooks/session-start.js.

  • Recognized defenses (defenses[] in JSON, "Recognized Defenses" in terminal and markdown) are credited, ne, and never add points.

  • Score weighting discounts non-secret template-example and docs-example findings to 0.25x, non-secret project-local-optional findings to 0.75x, and non-secret plugin-cache / plugin-manifest findings to 0.5x; committed secrets still count at full weight. Non-secret template-example findings are also capped at 10 deduction points per file and score category. See false-positi.md.
  • API Reference

    AgentShield currently has three distinct automation surfaces:

  • CLI: agentshield scan, agentshield init, and agentshield miniclaw start

  • Scanner report JSON/SARIF: agentshield scan --format json or agentshield scan --format sarif --output agentshield.sarif

  • Organization policy gate: agentshield scan --policy agentshield-policy.json

  • MiniClaw package + HTTP API: ecc-agentshield/miniclaw
  • Important packaging note:

  • The npm package root export currently points at the CLI entrypoint, not a sem scanner library module.

  • Internal scanner modules such as src/scanner/index.ts and src/reporter/score.ts are useful for contributors, but they should not be documented as supported import paths for package consumers yet.

  • If you need automation around scanner results today, prefer the JSON report format o scanner internals from the package root.
  • Detailed request/response and schema notes live in API.md.

    GitHub Action

    Inputs:

    | Input | Default | Description |
    |-------|---------|-------------|
    |
    path | . | Path to scan |
    |
    min-se | medium | Minimum se: critical, high, medium, low, info |
    |
    fail-on-findings | true | Fail the action if findings meet se threshold |
    |
    format | terminal | Output format: terminal, json, markdown, sarif |
    |
    sarif-output | agentshield-results.sarif | SARIF output path when format is sarif |
    |
    baseline | "" | Optional AgentShield baseline JSON path for drift comparison |
    |
    sa | "" | Optional path to write the current scan as a new baseline |
    |
    policy | "" | Optional organization policy JSON path |
    |
    fail-on-policy | true | Fail the action if the organization policy is non-compliant |
    |
    supply-chain | true | MCP npm/git package pro and known malicious package risk |
    |
    supply-chain-online | false | Query npm registry metadata during supply-chain |
    |
    fail-on-supply-chain | follows fail-on-findings | Fail the action when supply-chain finds critical or high package risks |
    |
    e | "" | Optional directory for a portable audit e bundle |
    |
    | true | e artifact hashes after writing |
    |
    policy-promotion-manifest | "" | Optional policy export manifest to and promote or dry-run |
    |
    policy-promotion-pack | "" | Policy pack id when the manifest contains multiple packs |
    |
    policy-promotion-output | .agentshield/policy.json | Acti path to write when promotion dry-run is disabled |
    |
    policy-promotion-dry-run | true | promotion review e without writing the acti |
    |
    fail-on-policy-promotion | false | Fail when promotion review items still require action |

    Outputs: score (0–100), grade (A–F), total-findings, critical-count, sarif-path, baseline-path, baseline-status, new-findings, resol, unchanged-findings, score-delta, policy-status, policy-, policy-promotion-status, policy-promotion-pack, policy-promotion-re, policy-promotion-action-required-count, policy-promotion-digest, supply-chain-status, supply-chain-risky-packages, supply-chain-critical-count, supply-chain-high-count, package-manager-hardening-status, package-manager-hardening-findings, package-manager-hardening-critical-count, package-manager-hardening-high-count, package-manager-hardening-registry-credentials, package-manager-hardening-lifecycle-scripts, package-manager-hardening-release-age-gates, e, e, e

    The action writes a markdown job summary and emits GitHub annotations inline on affected files. When format: sarif is set, it also writes a SARIF 2.1.0 report that can be uploaded to GitHub code scanning with github/codeql-action/upload-sarif. When baseline is set, the action appends a baseline drift summary, emits regression annotations for new findings, and reports baseline-status as passed, failed, missing, or not-run. When policy is set, the SARIF report includes organization-policy as agentshield-policy/* code-scanning results, appends the organization policy result to the job summary, emits policy annotations, and fails by default unless fail-on-policy: "false" is set. When policy-promotion-manifest is set, the action the selected policy export digest, emits promotion re counts, appends the owner/protected-rollout/runtime-smoke review items to the job summary, and marks runtime smoke as when the same job also scans with the promoted policy. Supply-chain runs offline by default for MCP package references, appends package-risk e to the job summary, writes real supply-chain.json e packs, and fails on critical/high package risk whenever the action is in failing mode unless fail-on-supply-chain: "false" is set. Package-manager hardening outputs and job-summary e separately count plaintext registry credentials, lifecycle-script drift, and release-age gate drift so CI and hosted consumers can route supply-chain configuration risk even when the main finding gate is collecting e only.

    Baseline drift gate:

    Use fail-on-findings: "false" when the workflow should fail only on drift from the baseline. Keep the default fail-on-findings: "true" when any current finding at or above min-se should still fail the action.

    CLI Reference

    Report footer CTA: terminal and markdown reports can append a one-line ECC
    Tools Pro footer. It is off by default. Set
    AGENTSHIELD_CTA=1 (or
    ECC_CTA=1) to enable it; set AGENTSHIELD_NO_CTA=1 (or ECC_NO_CTA=1) to
    hard-suppress it, which wins o. JSON and SARIF output ne
    it.

    Baseline write:

    The baseline command is a first-class wrapper around the existing scan baseline
    format. New baselines store stable hashed e fingerprints and omit raw
    e , so teams can keep baseline snapshots in CI without copying
    token-shaped strings into long-li. Existing raw-e baselines
    remain comparable during migration. Use it to create the accepted snapshot,
    then compare future scans with
    agentshield scan --baseline .github/agentshield-baseline.json --gate.

    Runtime monitor lifecycle:

    Organization policy files support enterprise metadata and temporary exceptions:

    Policy pack presets are starter baselines, not hidden SaaS policy. oss keeps
    public repos permissi requiring destructi deny entries;
    team adds the runtime hook; enterprise raises score gates and blocks broad
    tool allowlists;
    regulated disallows critical/high findings and bans broader
    MCP/tool surfaces;
    high-risk-hooks-mcp focuses on hook/MCP-hea; and
    ci-enforcement is tuned for branch-protection e.

    Policy export writes one JSON policy file per selected pack plus a
    manifest.json containing SHA-256 digests. This gi teams a stable
    artifact bundle for branch-protection review, audit attachment, or downstream
    policy promotion without relying on generated console output.

    Policy promotion is the review gate for those exported bundles. It reads the
    export manifest, the selected policy file digest, the policy
    schema, and only then writes the acti path. Use
    --dry-run --json in
    review workflows to prove the exact pack, source file, output path, owner list,
    and digest before a protected branch or operator copies the policy into place.
    Promotion results also include
    re for owner approval, protected PR
    rollout, and the runtime smoke test needed before enabling an enforcing CI gate.

    Policy e now includes an exception lifecycle audit in terminal output
    and GitHub Action summaries: total exceptions, acti, exceptions
    expiring within seven days, expired exceptions, owners, tickets, scopes, and
    days until expiry. This keeps temporary waivers in branch-protection
    e instead of letting them become silent permanent bypasses.

    Exit codes:

  • 0: scan completed without critical findings

  • 1: CLI usage or runtime error

  • 2: scan completed and found at least one critical issue
  • Security Rules Summary

    | Category | Rules | Patterns | Se Range |
    |----------|-------|----------|----------------|
    | Secrets | 10 | 14 | Critical -- Medium |
    | Permissions | 10 | -- | Critical -- Medium |
    | Hooks | 34 | -- | Critical -- Low |
    | MCP Servers | 23 | -- | Critical -- Info |
    | Agents | 25 | -- | Critical -- Info |
    | Total | 102 | 14 | |

    Architecture

    MiniClaw

    MiniClaw is a minimal, sandboxed AI agent runtime bundled with AgentShield. Where typical agent platforms expose many attack surfaces (single HTTP endpoint backed by an isolated sandbox.

    Or use as a library:

    MiniClaw-specific package exports and HTTP endpoints are documented in src/miniclaw/README.md and summarized in API.md. The React dashboard source lives in src/miniclaw/dashboard.tsx, but it is not yet published as a separate npm subpath.

    Security Model

    Four independently enforced layers:

  • Server — Rate limiting (10 req/min/IP), CORS, 10KB request cap, localhost-only binding

  • Prompt Router — Strips 12+ injection pattern categories (system prompt o, identity reassignment, jailbreaks, data exfiltration URLs, zero-width Unicode, base64 payloads)

  • Tool Whitelist — Three tiers: Safe (read/search/list), Guarded (write/edit), Restricted (bash/network — disabled by default)

  • Sandbox — Isolated filesystem per session, path tra blocked, symlink escape detection, extension whitelist, 10MB file cap, 5-min timeout, no network by default
  • HTTP API

    | Method | Endpoint | Description |
    |--------|----------|-------------|
    |
    POST | /api/prompt | Send a prompt |
    |
    POST | /api/session | Create a sandboxed session |
    |
    GET | /api/session | Session info |
    |
    DELETE | /api/session/:id | Destroy session + cleanup |
    |
    GET | /api/events/:sessionId | Security audit events |
    |
    GET | /api/health | Health check |

    MiniClaw has zero external runtime dependencies — Node.js built-ins only (http, fs, path, crypto). The optional React dashboard requires React 18+ as a peer dependency.

    De

    Distribution

    AgentShield is a through multiple channels:

    | Channel | Use Case | Install |
    |---------|----------|---------|
    | Standalone CLI | Direct scanning from your terminal |
    npm install -g ecc-agentshield or npx ecc-agentshield scan |
    | GitHub Action | Automated security checks on PRs in CI/CD |
    uses: affaan-m/agentshield@v1 |
    | ECC Plugin | Claude Code users via the ECC skill ecosystem | Install through E Claude Code |
    | ECC Tools GitHub App | Integrated scanning across your GitHub org | Install at github.com/apps/ecc-tools |
    | ECC Tools Pro | GitHub App with automated repo analysis, Stripe billing ($19/seat/mo) | Install |

    FAQ

    What is AgentShield?

    AgentShield is a security auditor for AI agent configurations. It scans Claude Code setups for hardcoded secrets, permission misconfigs, hook injection, MCP ser, and agent prompt injection .

    | Feature | Description |
    |---------|-------------|
    | Security Auditor | Scans
    .claude/ directory for |
    | Multiple Surfaces | CLI, GitHub Action, GitHub App integration |
    | Auto-Fix | Replaces hardcoded secrets with env |
    | Graded Reports | Security score (0-100) with findings breakdown |
    | Opus Pipeline | Three-agent ad analysis with Anthropic API |
    | E Pack | Portable audit bundle for compliance |

    What can AgentShield detect?

    | Category | Examples |
    |----------|----------|
    | Secrets | Hardcoded API keys, tokens, private keys, connection strings |
    | Permissions | Overly permissi rules like
    Bash(*)` |
    | Hooks | Hook injection , unsafe hooks |
    | MCP Servers | MCP ser, malicious MCP configs |
    | Agents | Agent prompt injection |

    How to get started?

    Quick Start (no install):

    Install globally:

    Auto-fix safe issues:

    What output formats are a?

    | Format | Use Case |
    |--------|----------|
    | Default | Terminal graded security report |
    | JSON | CI pipelines and automation |
    | HTML | Executi report |
    | E Pack | Portable audit bundle for compliance |

    What is the Opus Pipeline?

    The Opus Pipeline is a three-agent ad analysis that runs on Claude Opus through the Anthropic API:
    1. Attacker: hunts for exploitable weaknesses in the scanned config
    2. Defender: proposes concrete hardening for each weakness
    3. Auditor: reconciles both views into a ranked risk assessment

    Usage:

    What is MiniClaw?

    MiniClaw is a sandboxed agent runtime included with AgentShield:

  • Prompt Router: Strips 12+ injection pattern categories

  • Tool Whitelist: Safe/Guarded/Restricted tiers

  • Sandbox: Isolated filesystem, path tra blocked

  • HTTP API: REST endpoints for session management
  • Is AgentShield free and open source?

    Yes! AgentShield is MIT licensed and free to use. Built at the Claude Code Hackathon (Cerebral x Anthropic, Feb 2026).

    How to contribute?

    Contributions welcome! Check the repository for issues and pull requests. See CONTRIBUTING.md for guidelines.

    Where to get help?

    | Resource | Link |
    |----------|------|
    | Repository | github.com/affaan-m/agentshield |
    | npm Package | npmjs.com/package/ecc-agentshield |
    | Changelog | CHANGELOG.md |
    | E Claude Code | github.com/affaan-m/e |
    | Twitter | |

    License

    MIT

    ---

    <di="center">

    Built by · Part of E Claude Code

    </div>

    项目信息

    开发语言:TypeScript

    Star 数:1255

    技术要点

    该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。

    从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。

    使用与学习建议

    1. 下载源码压缩包,解压到本地环境。

    2. 根据项目类型准备对应的运行环境与依赖。

    3. 按照 README 中的步骤完成配置与部署。

    4. 在隔离的测试环境中运行验证,避免影响生产系统。

    免责声明

    本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。

    资源标题agentshield - AI agent security scanner. Detect vulnerabilities
    所属分类安全软件
    发布作者admin
    发布时间2026-10-05 22:33:34
    下载权限 免费下载
    附件数量2 个下载链接
    浏览次数248
    讨论数量0
    主题状态正常讨论中

    本资源免费,登录后即可在本页「下载链接」区域获取全部附件。

    请在评论区留言说明具体链接,或联系作者补档。楼主更新后本页会同步最新的下载地址。

    请先阅读正文中的授权说明;未注明的默认仅限站内学习交流,禁止直接搬运到其他站点二次售卖。
    还没有讨论,快来抢沙发~
    登录 后才能参与讨论
    下载链接
    会员才能下载
    登录后开通会员
    同分类推荐
    暂无同类资源
    免费登录即可下载
    查看会员
    放大预览

    © 2026 剑庭安 - 网站开发定制 SEO 优化蜘蛛池代做 在线看手相算命. 保留所有权利。

    Powered by 酷像SEOv3.0

    网站地图 Sitemap.xml
    首页 全部分类 黑客安全 逆向|反编译 精品源码 站长工具自助开通会员其他资源SEO工具站群源码泛程序蜘蛛模板蜘蛛池外链工具创意乐园 搜索 会员服务 登录 注册