Introducing a new way to review your PRs.

Read the announcement

affaan-m / agentshield

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. 🛡️

View on GitHub

20 documents · Updated Sep 11, 2026

overview

Knowledge Base updated: 2026-09-10

AgentShield knowledge base

AgentShield is a TypeScript security-analysis toolkit for AI-agent repositories. It combines repository discovery and rule-based scanning with policy governance, adversarial validation, supply-chain checks, runtime services, and reports that help teams act on findings.

The primary execution boundary is the shared analysis entrypoint in src/index.ts, which coordinates scanning and produces typed results defined in src/types.ts. GitHub Action and Opus-oriented orchestration layers adapt those capabilities for automated and AI-assisted workflows.

Critical security state is represented as discovered repository material and source context, rule findings and fingerprints, policy/baseline decisions, compliance results, and rendered evidence or remediation output. MiniClaw services and sandbox execution provide operational and isolated-validation surfaces.

flowchart TD
  Repo[Repository inputs] --> Discovery[Repository discovery and context]
  Discovery --> Static[Static security analysis]
  Static --> Rules[Security rule engine]
  Rules --> Findings[Findings and shared result types]
  Findings --> Policy[Policy governance]
  Policy --> Compliance[Compliance assessment]
  Policy --> Baselines[Baselines and fingerprints]
  Findings --> Injection[Injection and taint testing]
  Injection --> Sandbox[Sandbox execution]
  Sandbox --> Adversarial[Adversarial security validation]
  Findings --> Supply[Supply-chain security]
  Supply --> Intel[Threat intelligence]
  Findings --> Reports[Reporting remediation and monitoring]
  Reports --> Runtime[Runtime and MiniClaw services]
  Automation[Automation orchestration] --> Findings
  Opus[Opus analysis orchestration] --> Findings
flowchart LR
  Scan[Scan repository] --> Evaluate[Evaluate rules]
  Evaluate --> Fingerprint[Fingerprint findings]
  Fingerprint --> Compare[Compare baseline]
  Compare --> Policy[Evaluate policy]
  Policy --> Assess[Assess compliance]
  Assess --> Report[Render actionable report]

Glossary

  • Finding — A typed security issue emitted by a rule or analysis capability.
  • Source context — Repository-derived content and metadata supplied to scanning and analysis components.
  • Fingerprint — A stable identity used to compare findings with a stored baseline.
  • MiniClaw — The runtime service surface that exposes agent-oriented tools, routing, dashboard, and sandbox capabilities.
  • Evidence pack — Collected, report-facing material that supports review and remediation of findings.

Codebase-wide invariants

  • Shared analysis results and public configuration remain typed at the common boundary in src/types.ts; orchestration layers should consume rather than redefine these contracts.
  • Repository content enters static checks through scanner discovery and source-context construction (src/scanner/** and src/source-context.ts) before rule evaluation.
  • Rule-family registration is centralized in src/…/index.ts, so new rules must be wired there to participate in coordinated static analysis.
  • Findings intended for governance comparison must retain stable fingerprint semantics through the baseline and policy paths (src/baseline/**, src/policy/**).
  • Human- and machine-facing result rendering is owned by reporter modules (src/reporter/**); output-specific formatting should not change the underlying finding model.

Routing table

Paths or triggerDocumentation
src/index.ts, src/types.ts, action.yml, .github/actions/**Automation orchestration
src/action/**, src/actions/**, action.yml, .github/workflows/**GitHub Action entrypoints
src/opus/**, tests/opus/**Opus analysis orchestration
src/…/index.ts, src/…/index.tsStatic security analysis
src/…/discovery.ts, src/…/parsers.ts, src/…/paths.ts, src/source-context.ts, tests/scanner/**Repository discovery and context
src/rules/**, tests/rules/**Security rule engine
src/policy/**, src/promotion/**, src/…/index.tsPolicy governance
src/policy/**, src/presets/**, src/promotion/**Policy evaluation and promotion
src/baseline/**, src/fingerprint/**, tests/baseline/**Baselines and fingerprints
src/compliance/**, tests/compliance/**Compliance assessment
src/injection/**, src/sandbox/**Adversarial security validation
src/injection/**, tests/injection.test.ts, src/taint/**Injection and taint testing
src/sandbox/**, tests/sandbox/**Sandbox execution
src/supply-chain/**, src/cve/**, tests/supply-chain/**Supply-chain security
src/supply-chain/**, tests/supply-chain/**Supply-chain verification
src/cve/**, tests/cve/**Threat intelligence
src/runtime/**, src/miniclaw/**, src/…/index.tsRuntime and operations
src/runtime/**, src/miniclaw/**, tests/miniclaw/**Runtime and MiniClaw services
src/reporter/**, src/evidence-pack/**, src/fixer/**, src/watch/**Reporting remediation and monitoring