{"path":"README.md","size":2572,"locked":false,"binary":false,"truncated":false,"content":"# Agent Workspace Guard SDK\n\n> **Filesystem confinement and command-policy guardrails for autonomous coding agents.**\n\n[![Tests](https://img.shields.io/badge/tests-110%20passed-brightgreen.svg)](tests/adversarial-red-team.test.mjs)\n[![License](https://img.shields.io/badge/license-Commercial%20Source-blue.svg)](LICENSE.md)\n[![Zero Runtime Deps](https://img.shields.io/badge/dependencies-0%20runtime-green.svg)](DEPENDENCIES.md)\n\n---\n\n## 1. WHAT IS THIS?\nThe **Agent Workspace Guard SDK** is a lightweight, zero-dependency Node.js developer security library that prevents autonomous AI coding agents (such as tool-calling LLMs, Cursor extensions, Claude Code tools, or custom agents) from escaping their designated working directory or running dangerous host commands.\n\n## 2. WHO IS IT FOR?\n- Developers building autonomous coding agent workflows.\n- DevSecOps engineers integrating AI agent tools into developer machines.\n- SaaS platforms allowing AI agents to read and modify project files locally.\n\n## 3. WHAT PROBLEM DOES IT SOLVE?\nAI agents given shell and file-access tools can be tricked via prompt injection or unexpected planning into reading `.env` credentials, following symlinks outside the workspace, escaping with `../../`, or executing destructive commands like `rm -rf /` or `sudo`. Heavy cloud microVMs (E2B, Modal) introduce 200ms+ network latency and $50–$200/mo cloud bills. This SDK provides in-process, sub-millisecond confinement directly in your Node.js runtime.\n\n## 4. WHY PAY FOR IT INSTEAD OF BUILDING IT?\nWriting ad-hoc regex or path checks fails on real-world edge cases: symlink race conditions (`TOCTOU`), Windows backslash traversal evasion (`..\\..\\`), multi-dot evasion (`....//`), shell chaining metacharacters (`;`, `&&`, `|`, `$()`), and command redirection (`<`, `>`). This SDK includes an verified by the included reproducible 110-case adversarial red-team test suite covering these exact attack vectors.\n\n## 5. WHAT IS VERIFIED?\n- **110 / 110 Adversarial Attack Cases Passed:** Covering path traversal, symlink escapes, secret files, command chaining, and destructive command patterns.\n- **Zero External Runtime Dependencies:** Built strictly on Node.js standard library (`node:fs`, `node:path`, `node:crypto`).\n- **Cryptographic Audit Log:** Every command evaluation is chained using SHA-256 digests.\n\n## 6. HOW DO I RUN IT?\n```bash\n# 1. Run the 110-case adversarial security test suite\nnode --test tests/adversarial-red-team.test.mjs\n\n# 2. Run the interactive agent runner demonstration\nnode examples/agent-runner-example.mjs\n```\n"}