Production-ready security assessment engine for Model Context Protocol (MCP) servers — automates vulnerability detection, security analysis, evidence collection, risk assessment, and report generation.
README
AI Agent Security Attack Lab
Controlled security testing and evidence-driven assessment platform for AI agents and MCP servers.
AI Agent Security Attack Lab is a local-first security platform for discovering, testing, validating, and reporting security behavior in MCP servers and tool-using AI agent workflows.
It connects MCP discovery, capability analysis, controlled attack execution, evidence collection, security findings, risk analysis, attack-path correlation, policy decisions, remediation, and professional security reporting into one security workflow.
Product
AI Agent
│
▼
MCP Server / Tools
│
▼
┌──────────────────────────────────────────┐
│ AI AGENT SECURITY ATTACK LAB │
├──────────────────────────────────────────┤
│ Discovery & Capability Inventory │
│ Safety Attestation │
│ Controlled Attack Scenarios │
│ Agent Action Gate │
│ Execution Trace │
│ Evidence & Result Validation │
│ Findings & Risk │
│ Attack Graph & Correlation │
│ Policy & Security Decisions │
│ Remediation & Reporting │
└──────────────────────────────────────────┘
Core Security Model
MCP SERVER
│
▼
DISCOVERY
│
▼
CAPABILITY INVENTORY
│
▼
SAFETY ATTESTATION
│
▼
SCENARIO PRECONDITIONS
│
▼
CONTROLLED AGENT
│
▼
ACTION GATE
│
▼
CONTROLLED TOOL EXECUTION
│
▼
OBSERVATION + EXECUTION TRACE
│
▼
RESULT VALIDATION
│
▼
SECURITY FINDING
│
├──────────────► RISK
│
├──────────────► ATTACK GRAPH
│
├──────────────► POLICY
│
└──────────────► REMEDIATION
│
▼
SECURITY REPORT
The platform is designed to distinguish between a security signal, a controlled execution, and a validated security result.
Why AI Agent Security Attack Lab?
Modern AI agents increasingly interact with tools, APIs, filesystems, networks, and external services.
That creates a security testing problem:
It is not enough to inspect what an agent or MCP server can theoretically do. Security teams need controlled evidence of what actually happens when security-relevant behavior is exercised.
AI Agent Security Attack Lab is designed around that principle:
THEORY
│
▼
PRECONDITION
│
▼
CONTROLLED TEST
│
▼
OBSERVATION
│
▼
EVIDENCE
│
▼
VALIDATED RESULT
No attack should be treated as proven solely because static metadata suggests that it might be possible.
Security Capabilities
MCP Security Assessment
- MCP server discovery
- Tool and capability discovery
- Static security inventory
- Runtime discovery
- Streamable HTTP analysis
- Authentication probing
- Network and endpoint analysis
- Security rule evaluation
- Evidence collection
- Finding generation
- Risk scoring
- Confidence assessment
- Security policy decisions
- Attack-path correlation
- Remediation guidance
AI Agent Security Testing
The controlled agent layer provides:
- Explicit action requests
- Tool approval through an action gate
- Approved MCP tool inventory
- Controlled tool execution
- Observation capture
- Execution trace preservation
- Timeout handling
- Failure handling
- Blocked-action evidence
- Reproducible security testing
Controlled Attack Lab
The Attack Lab validates security behavior through explicitly defined scenarios.
V1 Attack Scenarios
| ID | Scenario | Security Focus |
|---|---|---|
TP-001 |
Tool Poisoning | Malicious or unsafe instructions exposed through tool metadata |
PI-001 |
Prompt Injection | Controlled prompt injection through tool output |
PA-001 |
Permission Abuse | Controlled excessive-permission behavior |
SD-001 |
Sensitive Data Exposure | Controlled sensitive-data exposure |
EX-001 |
Controlled Exfiltration | Controlled exfiltration behavior |
CE-001 |
Command Execution | Controlled command-execution behavior |
FS-001 |
Filesystem Abuse | Controlled filesystem/path-abuse behavior |
SSRF-001 |
SSRF / Network Abuse | Controlled network request behavior |
CT-001 |
Cross-Tool Chaining | Security-relevant cross-tool chaining |
MS-001 |
Multi-Step Attack | Multi-step attack behavior |
Attack Execution Lifecycle
Every controlled scenario follows the same evidence-first lifecycle:
┌─────────────────────┐
│ Attack Scenario │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Preconditions │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Safety Validation │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Controlled Agent │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Action Gate │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ MCP Tool Execution │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Observation │
│ + Execution Trace │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Evidence Validation │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Security Result │
└─────────────────────┘
Safety Architecture
Security testing is designed to fail closed.
The controlled execution layer uses explicit safety boundaries:
- Docker-based isolated execution
- Non-root execution
- Restricted network access
- Synthetic attack data
- Approved MCP tool inventory
- Capability-aware orchestration
- Scenario-specific preconditions
- Controlled execution channels
- Bounded execution time
- Bounded output
- Process/resource restrictions
- Cleanup verification
- Execution traces
- Result validation
Dangerous Capability Principle
Tool metadata does not automatically grant dangerous capabilities.
Capabilities such as:
PROCESS
FILESYSTEM
NETWORK
must be exercised through controlled execution paths and validated with scenario-specific evidence.
The engine does not infer dangerous runtime capability merely because a
tool description contains words such as shell, file, network, or
exec.
If a required safety boundary cannot be established:
DO NOT EXECUTE
The engine records the appropriate blocked or unavailable result.
Result Model
Every attack scenario produces one of the following states:
PROVEN
BLOCKED
PARTIAL
FAILED
NOT_APPLICABLE
ERROR
Meaning
| Result | Meaning |
|---|---|
PROVEN |
The defined scenario produced validated evidence |
BLOCKED |
Execution was stopped by a security or safety control |
PARTIAL |
Part of the expected behavior was observed |
FAILED |
Execution did not complete as expected |
NOT_APPLICABLE |
Required capability or scenario condition was unavailable |
ERROR |
Scenario/framework execution encountered an error |
The engine does not:
- Convert theoretical conditions into proof
- Fabricate evidence
- Claim impact that was not observed
- Execute when safety boundaries cannot be established
Evidence Model
Security evidence is preserved across the assessment pipeline.
SCENARIO
│
▼
PRECONDITIONS
│
▼
ACTION REQUESTED
│
▼
ACTION ALLOWED / BLOCKED
│
▼
ACTION EXECUTED
│
▼
ACTION OBSERVED
│
▼
EVIDENCE
│
▼
VALIDATED FINDING
This makes security results traceable from the final report back to the controlled action that produced them.
Finding → Risk → Decision
Validated findings are integrated into the existing security intelligence pipeline.
SECURITY FINDING
│
┌─────────────┼─────────────┐
▼ ▼ ▼
Severity Confidence Evidence
│ │ │
└─────────────┼─────────────┘
▼
RISK ENGINE
│
▼
ATTACK GRAPH
│
▼
POLICY ENGINE
│
┌──────────┼──────────┐
▼ ▼ ▼
ALLOW REVIEW BLOCK
│
▼
REMEDIATION
│
▼
REPORT
Risk Assessment
Risk scoring incorporates security intelligence such as:
- Finding severity
- Confidenc
… README truncated here; the full file ships with the clone.
283 files
file contents open where the seller allows a preview; the rest is what you are buying
.github/2
docs/2
scripts/1
- scripts/copy-ui.mjs337 B
src/142
- src/agent/action-gate.ts725 B
- src/agent/agent-trace.ts402 B
- src/agent/controlled-agent.ts5 KB
- src/agent/types.ts1 KB
- src/analyzers/rules/r001-arbitrary-shell-execution.ts8 KB
- src/analyzers/rules/r002-unrestricted-filesystem-access.ts9 KB
- src/analyzers/rules/r003-secret-credential-exposure.ts6 KB
- src/analyzers/rules/r004-unrestricted-network-egress.ts8 KB
- src/analyzers/rules/r005-ssrf-internal-network-access.ts10 KB
- src/analyzers/rules/r006-tool-prompt-injection.ts12 KB
- src/analyzers/rules/r007-excessive-tool-permissions.ts13 KB
- src/analyzers/rules/r008-weak-missing-remote-authentication.ts5 KB
- src/analyzers/rules/r009-supply-chain-dependency-risk.ts9 KB
- src/analyzers/rules/r010-dangerous-data-flow-exfiltration-path.ts18 KB
- src/analyzers/runtime-r008.ts2 KB
- src/api/attack-lab-routes.ts6 KB
- src/api/github-routes.ts14 KB
- src/api/index.ts640 B
- src/api/server.ts33 KB
- src/api/source-audit.ts8 KB
- src/attack/attack-finding-adapter.ts4 KB
- src/attack/attack-lab.ts2 KB
- src/attack/capabilities-filesystem.ts2 KB
- src/attack/capabilities-process.ts1 KB
- src/attack/capability-adapter.ts790 B
- src/attack/controlled-mcp-session.ts2 KB
- src/attack/default-registry.ts1 KB
- src/attack/execution-bridge.ts2 KB
- src/attack/executor.ts3 KB
- src/attack/fixtures/synthetic-files.ts262 B
- src/attack/fixtures/synthetic-secrets.ts297 B
- src/attack/fixtures/synthetic-tools.ts454 B
- src/attack/preconditions.ts4 KB
- src/attack/registry.ts2 KB
- src/attack/result-validator.ts1 KB
- src/attack/runner.ts2 KB
- src/attack/safety-attestation.ts5 KB
- src/attack/scenarios/command-execution.ts4 KB
- src/attack/scenarios/controlled-exfiltration.ts5 KB
- src/attack/scenarios/cross-tool-chaining.ts5 KB
- src/attack/scenarios/execution-helpers.ts2 KB
- src/attack/scenarios/filesystem-abuse.ts4 KB
- src/attack/scenarios/multi-step.ts5 KB
- src/attack/scenarios/permission-abuse.ts5 KB
- src/attack/scenarios/precondition-helpers.ts2 KB
- src/attack/scenarios/prompt-injection.ts2 KB
- src/attack/scenarios/scenario-helpers.ts2 KB
- src/attack/scenarios/sensitive-data-exposure.ts2 KB
- src/attack/scenarios/ssrf.ts4 KB
- src/attack/scenarios/tool-poisoning.ts2 KB
- src/attack/types.ts2 KB
- src/auth/auth-service.ts1 KB
- src/auth/http.ts2 KB
- src/auth/identity.ts964 B
- src/auth/index.ts154 B
- src/auth/session.ts3 KB
- src/auth/types.ts1 KB
- src/baseline/diff.ts3 KB
- src/cli/index.ts468 B
- src/cli/program.ts5 KB
- src/core/confidence-score.ts607 B
- src/core/decision.ts2 KB
- src/core/finding-schema.ts2 KB
- src/core/finding.ts1 KB
- src/correlation/attack-graph.ts3 KB
- src/discovery/capability-inventory-builder.ts937 B
- src/discovery/capability-inventory.ts1 KB
- src/discovery/discover.ts521 B
- src/discovery/discovery-result.ts202 B
- src/discovery/dns-pinned-dispatcher.ts3 KB
- src/discovery/dns-security.ts1 KB
- src/discovery/ip-security.ts3 KB
- src/discovery/mcp-http-connector.ts3 KB
- src/discovery/runtime-auth-probe.ts2 KB
- src/discovery/runtime-capability-discovery.ts4 KB
- src/discovery/secure-fetch.ts7 KB
- src/discovery/source-discovery.ts2 KB
- src/discovery/static-capability-discovery.ts1 KB
- src/discovery/target-resolver.ts905 B
- src/discovery/types.ts219 B
- src/discovery/url-security.ts869 B
- src/entitlements/account-provisioning.ts990 B
- src/entitlements/default-entitlement.ts190 B
- src/entitlements/entitlement-service.ts2 KB
- src/entitlements/index.ts155 B
- src/entitlements/types.ts785 B
- src/evidence/evidence-aggregator.ts2 KB
- src/github/authorization-service.ts3 KB
- src/github/authorization.ts756 B
- src/github/connection-lifecycle.ts2 KB
- src/github/connection-manager.ts2 KB
- src/github/credential-crypto.ts5 KB
- src/github/credential-errors.ts561 B
- src/github/credential-provider.ts1 KB
- src/github/credential-storage.ts100 B
- src/github/failure-normalizer.ts2 KB
- src/github/failure-states.ts3 KB
- src/github/http-oauth-client.ts6 KB
- src/github/http-repository-client.ts7 KB
- src/github/index.ts1 KB
- src/github/oauth-callback-service.ts8 KB
- src/github/oauth-client.ts1016 B
- src/github/oauth-state-service.ts4 KB
- src/github/oauth-state.ts1 KB
- src/github/persistent-github-connection-store.ts6 KB
- src/github/persistent-github-credential-store.ts5 KB
- src/github/persistent-github-oauth-state-store.ts4 KB
- src/github/persistent-repository-selection-store.ts6 KB
- src/github/repository-access-service.ts2 KB
- src/github/repository-archive-access-service.ts2 KB
- src/github/repository-archive-client.ts4 KB
- src/github/repository-client.ts1 KB
- src/github/repository-import-service.ts1 KB
- src/github/repository-selection-service.ts4 KB
- src/github/repository-selection.ts739 B
- src/github/types.ts844 B
- src/index.ts38 B
- src/policies/policy-engine.ts3 KB
- src/remediation/remediation-engine.ts10 KB
- src/reports/json-reporter.ts219 B
- src/reports/report-document.ts2 KB
- src/reports/report-writer.ts863 B
- src/reports/sarif-reporter.ts3 KB
- src/risk/risk-scoring.ts4 KB
- src/sandbox/docker-sandbox.ts8 KB
- src/scan/rule-registry.ts2 KB
- src/scan/scan-pipeline.ts14 KB
- src/scan/scan-progress.ts664 B
- src/storage/index.ts156 B
- src/storage/json-store.ts951 B
- src/storage/persistent-auth-store.ts5 KB
- src/storage/persistent-entitlement-store.ts3 KB
- src/storage/types.ts93 B
- src/ui/app.js38 KB
- src/ui/index.html20 KB
- src/ui/styles.css56 KB
- src/usage/index.ts194 B
- src/usage/no-enforcement-usage-policy.ts336 B
- src/usage/persistent-usage-store.ts4 KB
- src/usage/types.ts428 B
- src/usage/usage-period.ts222 B
- src/usage/usage-service.ts4 KB
tests/129
- tests/agent/agent-contracts.test.ts3 KB
- tests/agent/controlled-agent.test.ts6 KB
- tests/agent/controlled-execution-gate.test.ts1 KB
- tests/analyzers-runtime-r008.test.ts951 B
- tests/api/attack-lab-routes.test.ts11 KB
- tests/api/attack-lab.integration.test.ts4 KB
- tests/api/auth-routes.test.ts8 KB
- tests/api/auth-test-support.ts741 B
- tests/api/github-routes.test.ts18 KB
- tests/api/server.test.ts24 KB
- tests/attack/attack-contract.test.ts3 KB
- tests/attack/attack-finding-adapter.test.ts2 KB
- tests/attack/attack-framework.test.ts9 KB
- tests/attack/attack-lab.integration.test.ts2 KB
- tests/attack/attack-registry.test.ts712 B
- tests/attack/attack-runner-integration.test.ts8 KB
- tests/attack/attack-safety-evidence.test.ts2 KB
- tests/attack/capability-adapter.test.ts2 KB
- tests/attack/capability-gating.test.ts5 KB
- tests/attack/command-execution-mcp.integration.test.ts3 KB
- tests/attack/controlled-exfiltration-mcp.integration.test.ts4 KB
- tests/attack/controlled-exfiltration-sink-regression.test.ts1 KB
- tests/attack/controlled-mcp-agent.integration.test.ts3 KB
- tests/attack/controlled-mcp-session.test.ts1 KB
- tests/attack/cross-tool-chaining-mcp.integration.test.ts4 KB
- tests/attack/execution-bridge.test.ts4 KB
- tests/attack/filesystem-abuse-mcp.integration.test.ts2 KB
- tests/attack/multi-step-mcp.integration.test.ts4 KB
- tests/attack/permission-abuse-gate.test.ts2 KB
- tests/attack/permission-abuse-integration.test.ts2 KB
- tests/attack/permission-abuse-mcp.integration.test.ts4 KB
- tests/attack/process-capability.test.ts746 B
- tests/attack/prompt-injection-mcp.integration.test.ts3 KB
- tests/attack/result-validator.test.ts2 KB
- tests/attack/safety-attestation.test.ts1 KB
- tests/attack/sensitive-data-exposure-mcp.integration.test.ts2 KB
- tests/attack/ssrf-mcp.integration.test.ts3 KB
- tests/attack/tool-poisoning-runtime.test.ts1 KB
- tests/attack/tool-poisoning.test.ts3 KB
- tests/auth/auth-service.test.ts2 KB
- tests/auth/http.test.ts3 KB
- tests/auth/identity.test.ts2 KB
- tests/auth/session.test.ts5 KB
- tests/auth/support/in-memory-auth-store.ts2 KB
- tests/baseline/diff.test.ts4 KB
- tests/cli.test.ts5 KB
- tests/core-confidence-score.test.ts1 KB
- tests/core-finding.test.ts3 KB
- tests/correlation/attack-graph.test.ts4 KB
- tests/decision/decision.test.ts4 KB
- tests/discovery/capability-inventory-builder.test.ts3 KB
- tests/discovery/capability-inventory.test.ts2 KB
- tests/discovery/discover.test.ts1 KB
- tests/discovery/dns-pinned-dispatcher.test.ts3 KB
- tests/discovery/dns-security.test.ts755 B
- tests/discovery/ip-security.test.ts2 KB
- tests/discovery/mcp-http-adversarial.test.ts4 KB
- tests/discovery/mcp-http-connector.test.ts1015 B
- tests/discovery/mcp-http-security-connector.test.ts2 KB
- tests/discovery/real-mcp-http-runtime.test.ts1 KB
- tests/discovery/real-mcp-runtime.test.ts1 KB
- tests/discovery/runtime-auth-probe.test.ts639 B
- tests/discovery/runtime-capability-discovery.test.ts6 KB
- tests/discovery/secure-fetch.test.ts5 KB
- tests/discovery/source-discovery.test.ts1 KB
- tests/discovery/static-capability-discovery.test.ts2 KB
- tests/discovery/target-resolver.test.ts696 B
- tests/discovery/url-security.test.ts1 KB
- tests/entitlements/account-provisioning.test.ts2 KB
- tests/entitlements/entitlement-service.test.ts2 KB
- tests/evidence/evidence-aggregator.test.ts4 KB
- tests/fixtures/attack-lab-mcp-fixture.ts5 KB
- tests/fixtures/attack-lab-mcp-server.ts10 KB
- tests/fixtures/baseline/vulnerable-network-report.json7 KB
- tests/fixtures/real-mcp/http-server.ts3 KB
- tests/fixtures/real-mcp/server.ts483 B
- tests/fixtures/vulnerable-network/server.ts116 B
- tests/fixtures/vulnerable-ssrf/server.ts113 B
- tests/github-repository-scan.integration.test.ts6 KB
- tests/github/authorization-service.test.ts5 KB
- tests/github/connection-lifecycle.test.ts5 KB
- tests/github/connection-manager.test.ts5 KB
- tests/github/credential-crypto.test.ts2 KB
- tests/github/credential-provider.test.ts4 KB
- tests/github/failure-states.test.ts4 KB
- tests/github/http-oauth-client.test.ts6 KB
- tests/github/http-repository-client.test.ts5 KB
- tests/github/oauth-callback-service.test.ts9 KB
- tests/github/oauth-state.test.ts4 KB
- tests/github/persistent-github-connection-store.test.ts4 KB
- tests/github/persistent-github-credential-store.test.ts3 KB
- tests/github/persistent-repository-selection-store.test.ts4 KB
- tests/github/repository-access-service.test.ts5 KB
- tests/github/repository-archive-access-service.test.ts5 KB
- tests/github/repository-archive-client.test.ts10 KB
- tests/github/repository-selection-service.test.ts8 KB
- tests/policies/policy-engine.test.ts6 KB
- tests/r001.test.ts4 KB
- tests/r002.test.ts5 KB
- tests/r003.test.ts3 KB
- tests/r004.test.ts4 KB
- tests/r005.test.ts4 KB
- tests/r006.test.ts5 KB
- tests/r007.test.ts6 KB
- tests/r008.test.ts3 KB
- tests/r009-supply-chain-dependency-risk.test.ts7 KB
- tests/r010-dangerous-data-flow-exfiltration-path.test.ts7 KB
- tests/remediation/remediation-engine.test.ts7 KB
- tests/reports/json-reporter.test.ts4 KB
- tests/reports/report-document.test.ts5 KB
- tests/reports/report-writer.test.ts3 KB
- tests/reports/reports.test.ts2 KB
- tests/reports/sarif-reporter.test.ts5 KB
- tests/repository-import-service.test.ts2 KB
- tests/risk/risk-scoring.test.ts8 KB
- tests/rule-registry.test.ts1 KB
- tests/sandbox/docker-sandbox.test.ts16 KB
- tests/scan-progress.test.ts1 KB
- tests/scan/scan-pipeline.test.ts10 KB
- tests/source-audit.test.ts3 KB
- tests/storage/json-store.test.ts2 KB
- tests/storage/persistent-auth-store-concurrency.test.ts2 KB
- tests/storage/persistent-auth-store.test.ts4 KB
- tests/storage/persistent-entitlement-store.test.ts3 KB
- tests/storage/production-auth-boundary.test.ts3 KB
- tests/tsconfig.json141 B
- tests/usage/persistent-usage-store.test.ts4 KB
- tests/usage/usage-period.test.ts845 B
- tests/usage/usage-service.test.ts6 KB
- .gitignore352 B
- LICENSE1 KB
- README.md26 KB
- package-lock.json65 KB
- package.json1 KB
- tsconfig.json643 B
- vitest.config.ts205 B