{"id":50927612,"url":"https://github.com/declaw-ai/declaw-js","last_synced_at":"2026-06-18T02:01:11.718Z","repository":{"id":364482408,"uuid":"1266225926","full_name":"declaw-ai/declaw-js","owner":"declaw-ai","description":"TypeScript SDK for Declaw — security-first sandboxing for AI agents","archived":false,"fork":false,"pushed_at":"2026-06-16T23:04:57.000Z","size":222,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T01:02:45.332Z","etag":null,"topics":["agentic-ai","ai-agents","ai-security","code-execution","code-interpreter","firecracker","guardrails","javascript","llm","llm-security","microvm","nodejs","prompt-injection","sandbox","sandboxing","sdk","typescript"],"latest_commit_sha":null,"homepage":"https://declaw.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/declaw-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-11T12:32:13.000Z","updated_at":"2026-06-16T23:04:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/declaw-ai/declaw-js","commit_stats":null,"previous_names":["declaw-ai/declaw-js"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/declaw-ai/declaw-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declaw-ai%2Fdeclaw-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declaw-ai%2Fdeclaw-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declaw-ai%2Fdeclaw-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declaw-ai%2Fdeclaw-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/declaw-ai","download_url":"https://codeload.github.com/declaw-ai/declaw-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declaw-ai%2Fdeclaw-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34472826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","ai-agents","ai-security","code-execution","code-interpreter","firecracker","guardrails","javascript","llm","llm-security","microvm","nodejs","prompt-injection","sandbox","sandboxing","sdk","typescript"],"created_at":"2026-06-17T01:00:19.749Z","updated_at":"2026-06-18T02:01:11.668Z","avatar_url":"https://github.com/declaw-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @declaw/sdk\n\nSecure runtime for AI agents. Spin up isolated sandboxes in milliseconds with built-in guardrails — PII scanning, prompt injection defense, network isolation, and egress filtering.\n\n## Install\n\n```bash\nnpm install @declaw/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { Sandbox } from '@declaw/sdk';\n\nconst sandbox = await Sandbox.create({\n  apiKey: 'your-api-key',\n  template: 'base',\n  timeout: 60,\n});\n\n// Run commands\nconst result = await sandbox.commands.run('echo \"Hello from a secure sandbox\"');\nconsole.log(result.stdout);\n\n// Read/write files\nawait sandbox.files.write('/tmp/hello.txt', 'Hello World');\nconst content = await sandbox.files.read('/tmp/hello.txt');\n\n// Clean up\nawait sandbox.kill();\n```\n\n## Why Declaw?\n\nAI agents need to execute code, call APIs, and interact with the world. Declaw gives them a secure sandbox to do it — with built-in guardrails that protect your users and infrastructure.\n\n- **Sub-10ms sandbox creation** — pre-warmed VM pool, no cold starts\n- **Network isolation** — per-sandbox firewall with domain and CIDR rules\n- **Full file system** — read, write, upload, download files in the sandbox\n\n## Security \u0026 Guardrails\n\nEvery outbound request from the sandbox passes through a configurable security pipeline.\n\n### PII Scanning\n\nDetect and redact sensitive data before it leaves the sandbox.\n\n```typescript\nconst sandbox = await Sandbox.create({\n  security: SecurityPolicy.from({\n    pii: {\n      enabled: true,\n      types: ['ssn', 'credit_card', 'email', 'phone', 'api_key'],\n      action: 'redact',\n    },\n  }),\n});\n```\n\n### Prompt Injection Defense\n\nBlock prompt injection attempts in agent outputs.\n\n```typescript\nconst sandbox = await Sandbox.create({\n  security: SecurityPolicy.from({\n    injectionDefense: {\n      enabled: true,\n      action: 'block',\n      threshold: 0.85,\n    },\n  }),\n});\n```\n\n### Toxicity Filtering\n\n```typescript\nsecurity: SecurityPolicy.from({\n  toxicity: { enabled: true, action: 'block', threshold: 0.7 },\n})\n```\n\n### Code Security \u0026 Invisible Text Detection\n\n```typescript\nsecurity: SecurityPolicy.from({\n  codeSecurity: { enabled: true, action: 'log' },\n  invisibleText: { enabled: true, action: 'block' },\n})\n```\n\n### Network Policies\n\n```typescript\n// Allow only specific domains\nconst sandbox = await Sandbox.create({\n  network: { allowOut: ['api.openai.com', 'huggingface.co'] },\n});\n\n// Block all egress\nconst isolated = await Sandbox.create({\n  network: { denyOut: ['ALL_TRAFFIC'] },\n});\n```\n\n### Data Transformation\n\nTransform sensitive values in-flight.\n\n```typescript\nsecurity: SecurityPolicy.from({\n  transformations: [\n    { pattern: 'sk-[a-zA-Z0-9]+', replacement: '[API_KEY]', direction: 'egress' },\n  ],\n})\n```\n\n### Combining Guardrails\n\nAll guardrails compose — enable multiple and they run in sequence:\n\n```typescript\nconst sandbox = await Sandbox.create({\n  template: 'ai-agent',\n  timeout: 300,\n  network: { allowOut: ['api.openai.com', 'api.anthropic.com'] },\n  security: SecurityPolicy.from({\n    pii: { enabled: true, action: 'redact', types: ['ssn', 'credit_card'] },\n    injectionDefense: { enabled: true, action: 'block' },\n    toxicity: { enabled: true, action: 'log' },\n    invisibleText: { enabled: true, action: 'block' },\n  }),\n});\n```\n\n## Templates\n\n| Template | Description |\n|----------|-------------|\n| `base` | Minimal Linux |\n| `python` | Python 3.12 with pip |\n| `node` | Node.js 22 LTS with npm |\n| `code-interpreter` | Python with data science libraries |\n| `ai-agent` | Python + Node.js + AI/ML tools |\n| `mcp-server` | MCP server runtime |\n| `web-dev` | Node.js + browser testing |\n| `devops` | Docker, Terraform, kubectl |\n\n## API\n\n```typescript\n// Create sandbox\nconst sandbox = await Sandbox.create({ template, apiKey, timeout, network, security });\n\n// Commands\nconst result = await sandbox.commands.run('ls -la');\nconst stream = sandbox.commands.stream('python script.py');\n\n// Files — `path` is the literal absolute path inside the sandbox.\n// Files appear at exactly that path — no remapping, no bridge directory.\nawait sandbox.files.write(path, content);\nconst data = await sandbox.files.read(path);\nconst entries = await sandbox.files.list('/');\n\n// PTY (interactive terminal)\nconst pty = await sandbox.pty.create({ cols: 80, rows: 24 });\n\n// Lifecycle\nawait sandbox.kill();\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeclaw-ai%2Fdeclaw-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeclaw-ai%2Fdeclaw-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeclaw-ai%2Fdeclaw-js/lists"}