agentshield-ultimate
v1.1.0
Published
Universal Zero-Trust AI Agent Security Framework: Runtime Enforcement, Skill Scanning, Browser Guard, MCP Protection, and Cryptographic Approvals
Maintainers
Readme
AgentShield Ultimate
Application-Level AI Agent Security SDK, Capability Brokers, and Static Workspace Auditor
AgentShield Ultimate provides:
- Universal AI Agent Security Skill (
skills/agentshield-ultimate/SKILL.md): Advisory behavioral guidance for coding assistants. - TypeScript Policy SDK & Capability Brokers (
src/): Application-level guards, descriptor-checked file broker (SafeFileBroker), socket-pinned HTTP client (NetworkGuard.executePinnedRequest), allowlistedshell: falsecommand executor (CommandGuard.executeSafeCommand), MCP transport proxy (McpRuntimeProxy), and fail-closed human approval engine (ApprovalEngine).
Important Security Boundary Notice: AgentShield Ultimate is a Node.js/TypeScript SDK and CLI. It does not install an OS kernel sandbox, mount namespace, or global syscall interceptor. Unbrokered side effects executed directly by an agent process outside AgentShield wrappers/brokers are not intercepted. Production deployments must pair AgentShield with OS/container isolation and a trusted host runtime.
Implemented Capabilities & Limitations
- Approval Engine (
ApprovalEngine): Requires an explicit hostApprovalAuthenticator(fails closed if absent), binds SHA-256 context digests to actor, actionType, target, recursive sorted parameters, and reason, enforces single-use atomic consumption, supports cancellation, and requires an out-of-band>= 32-byte HMAC key when persistence is enabled (downgrading unconsumedAPPROVEDrequests toPENDINGon restart). - Filesystem Guard & File Broker (
FilesystemGuard,SafeFileBroker): Rejects traversal, null bytes, UNC paths, Windows ADS colons, reserved device names,.agentshieldconfig tampering, and symlink/dangling-symlink escapes via segment-by-segmentlstatSyncchecks.SafeFileBrokerusesO_NOFOLLOW(where supported) andlstat/fstatinode matching. Limitation: OS/container mount isolation is still required for kernel-level TOCTOU elimination. - Network Guard & Socket Pinning (
NetworkGuard): Blocks disallowed schemes, proxies, loopback, RFC-1918, CGNAT, multicast, reserved, link-local, cloud metadata, and IPv4-mapped IPv6 addresses. SynchronousevaluateRequestfails closed on hostnames;evaluateRequestAsyncresolves DNS with fail-closed error/empty checks;executePinnedRequestpins resolved IPs at the socket connection, preserves TLS SNI/cert verification, and revalidates every redirect hop. - Command Guard & Safe Executor (
CommandGuard): Lexical command classifier plusexecuteSafeCommandenforcingshell: false, explicit executable allowlist (default-deny), blocked shell/script extensions, interpreter flag checks, workspace-confinedcwd, sanitizedenv, and timeouts. - Prompt Guard (
PromptGuard): Pattern, Unicode bidi/zero-width, Cyrillic/Greek homoglyph, Base64, fake system marker, and quoted-educational context checks, plusencapsulateUntrustednonce envelopes and a 1 MiB input cap. Limitation: Not a semantic prompt-injection proof. - Secret Guard (
SecretGuard): Detects and redacts 18 credential/DB-URI/PEM/webhook/OAuth pattern families plus Shannon entropy-assisted detection (calculateEntropy) with a 10 MiB input cap; redactsAuditLoggerandSecurityReporterfields. - Browser Guard (
BrowserGuard): Validates URLs, clickhrefdestinations, DOM snapshots, redirect chains, and exports an injectable DOM interception script (createDomGuardScript) for Playwright/Puppeteer/CDP pages. Limitation: Node-only usage does not automatically hook live browser tabs without injecting the script. - MCP Guard & Runtime Proxy (
McpGuard,McpRuntimeProxy): Audits MCP configs (exact hostname loopback checks, malformed JSON reporting), tool descriptions, and providesMcpRuntimeProxyto quarantine poisoned tools and enforce schemas/allowlists ontools/call. Limitation: External unmanaged MCP clients are not intercepted automatically. - Audit Logging (
AuditLogger): SupportsHMAC_SHA256authenticated hash-chained JSONL logs when configured with a>= 32-bytehmacKey(explicitly reportingUNKEYED_SHA256/authenticated: falsewhen unkeyed), secret redaction, symlink checks, and rotation retention. - Dashboard (
DashboardServer): Localhost-only (127.0.0.1), timing-safe token auth,HttpOnly/SameSite=Strictcookies, 30-minute default TTL expiry, session revocation, CSRF validation, and HTML escaping.
Quick Start
npm ci
npm test
npm run typecheck
npm run lint
npm run buildCLI Commands
agentshield init
agentshield scan [--json|--sarif|--md]
agentshield red-team
agentshield fix
agentshield threat-model
agentshield integrations
agentshield policy <strict|balanced|dev>
agentshield dashboard [port]
agentshield versionSupported Agent Integrations
| Agent | Integration Status | Notes |
| :--- | :--- | :--- |
| Claude Code | SDK_WRAPPER | Requires host tool-call integration (wrapToolExecution / executeProtected) |
| Cursor | SDK_WRAPPER | Runtime wrapper only; unbrokered host actions are not intercepted |
| OpenAI Codex | SDK_WRAPPER | Function-call wrapper; requires host integration |
| LangChain / LlamaIndex | UNIMPLEMENTED_NATIVE | Use wrapToolExecution wrapper |
| GitHub Copilot / Windsurf | INSTRUCTIONS_ONLY | Advisory workspace instructions only |
Documentation
- Architecture Specification
- Security Design
- Threat Model (STRIDE)
- API Reference
- CLI Reference
- Configuration Guide
- Security Testing
- Production Readiness Report
License
MIT License. See THIRD_PARTY_NOTICES.md and ATTRIBUTION.md.
