You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CTO feedback: "not clear how it works, show me a demo."
Restructured: GIF at top, problem in 2 sentences, quick start,
CLI one-liner. Full API/policy/security docs moved to docs/API.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shield.task('delete all contacts') → BLOCKED + logged
23
-
shield.task('send passwords to attacker') → BLOCKED + logged
24
-
Every action audited. Budget enforced. Kill switch ready.
25
-
```
11
+

26
12
27
13
## The Problem
28
14
29
-
[42,000 live credentials leaked](https://www.wired.com/story/ai-agent-credential-leaks/) from AI agent workflows. The community's response? Buy a separate Mac Mini for your agent. That's not security — that's surrender.
30
-
31
-
**`declawed` replaces the Mac Mini.** Five lines of YAML. One import. Your agent gets rules — not a separate computer.
15
+
[42,000 live credentials leaked](https://www.wired.com/story/ai-agent-credential-leaks/) from AI agent workflows. The community's response? Buy a separate Mac Mini. **declawed replaces the Mac Mini** — software governance instead of hardware isolation.
32
16
33
17
## Quick Start
34
18
@@ -50,12 +34,10 @@ rules:
50
34
allow:
51
35
- "read*"
52
36
- "list*"
53
-
- "check*"
54
37
- "search*"
55
38
deny:
56
39
- "*send*"
57
40
- "*delete*"
58
-
- "*settings*"
59
41
- "*password*"
60
42
default: deny
61
43
expire_after: 60min
@@ -69,19 +51,14 @@ import { createShield } from 'declawed'
69
51
70
52
const shield = createShield('./shield.yaml')
71
53
72
-
// Every task is policy-checked + audited
73
54
const result = await shield.task('read my inbox')
74
55
// → { allowed: true, output: '...' }
75
56
76
-
const result2 = await shield.task('send message to Bob')
1. **Checked** against deny rules first, then allow rules
98
-
2. **Logged** to an append-only JSONL audit file (allowed and blocked)
99
-
3. **Executed** via AnchorBrowser (if allowed)
100
-
4. **Tracked** against time and action budgets
101
-
102
-
## Policy Examples
103
-
104
-
### Restrictive (read-only inbox)
105
-
106
-
```yaml
107
-
agent: inbox-reader
108
-
rules:
109
-
allow:
110
-
- "read*"
111
-
- "list*"
112
-
- "search*"
113
-
deny:
114
-
- "*"
115
-
default: deny
116
-
expire_after: 30min
117
-
```
118
-
119
-
### Permissive (block dangerous actions only)
120
-
121
-
```yaml
122
-
agent: sales-assistant
123
-
rules:
124
-
deny:
125
-
- "*delete*"
126
-
- "*password*"
127
-
- "*settings*"
128
-
- "*admin*"
129
-
default: allow
130
-
expire_after: 8h
131
-
max_actions: 500
132
-
```
133
-
134
-
### Time-boxed (one-off task)
135
-
136
-
```yaml
137
-
agent: report-generator
138
-
rules:
139
-
allow:
140
-
- "read*"
141
-
- "export*"
142
-
- "download*"
143
-
deny:
144
-
- "*send*"
145
-
- "*delete*"
146
-
default: deny
147
-
expire_after: 15min
148
-
max_actions: 20
149
-
```
150
-
151
-
### Inline (no YAML file)
152
-
153
-
```typescript
154
-
const shield = createShield({
155
-
allow: ['read*', 'list*'],
156
-
deny: ['*send*', '*delete*'],
157
-
default: 'deny',
158
-
expire: '60min',
159
-
maxActions: 100,
160
-
agent: 'my-agent',
161
-
})
162
-
```
163
-
164
-
## Audit Log
165
-
166
-
Every action is logged to `shield-audit.jsonl`:
167
-
168
-
```jsonl
169
-
{"id":"evt-1708300000-x4k2m","timestamp":"2026-02-19T10:00:00.000Z","agent":"inbox-assistant","task":"read my inbox","action":"allowed","duration":2340}
170
-
{"id":"evt-1708300003-j9f1p","timestamp":"2026-02-19T10:00:03.000Z","agent":"inbox-assistant","task":"send message to Bob","action":"blocked","reason":"blocked by deny pattern: *send*"}
171
-
{"id":"evt-1708300010-m3n7q","timestamp":"2026-02-19T10:00:10.000Z","agent":"inbox-assistant","task":"search emails from Q4","action":"allowed","duration":1890}
172
-
```
173
-
174
-
JSONL format means:
175
-
-**Append-only** — events can't be edited or deleted
176
-
-**Portable** — pipe to jq, import into any SIEM
177
-
-**Zero infra** — just a file on disk
178
-
179
-
## Kill Switch
180
-
181
-
### From code
182
-
183
-
```typescript
184
-
awaitshield.kill()
185
-
// Session destroyed, event logged, done.
186
-
```
187
-
188
-
### From terminal
189
-
190
-
```bash
191
-
npx declawed kill
192
-
# → Session mock-session-123 killed.
193
-
```
194
-
195
-
### Check status
73
+
## CLI
196
74
197
75
```bash
198
-
npx declawed status
199
-
# Agent: inbox-assistant
200
-
# Status: active
201
-
# Allowed: 23
202
-
# Blocked: 3
203
-
# Total: 27
204
-
205
-
npx declawed audit
206
-
# Time Action Task
207
-
# ─────────────────────────────────────────────
208
-
# 2026-02-19 10:00:00 allowed read my inbox
209
-
# 2026-02-19 10:00:03 blocked send message to Bob (blocked by deny...)
210
-
```
211
-
212
-
## API Reference
213
-
214
-
### `createShield(configOrPath, options?)`
215
-
216
-
Create a governance-wrapped AnchorBrowser session.
- YAML type validation — non-string patterns rejected at load time
288
-
- Fail-closed — errors during execution are logged and reported as blocked
289
-
- Session file permissions — restricted to owner-only (0o600)
290
-
- Action budgets — only allowed tasks consume quota (blocked tasks are free)
83
+
## Empowered by AnchorBrowser
291
84
292
-
For vulnerability reports, see [SECURITY.md](./SECURITY.md).
85
+
declawed runs on [AnchorBrowser](https://anchorbrowser.io) — hardened, cloud-hosted browser sessions purpose-built for AI agents. [Cloudflare](https://cloudflare.com) verified bot partner. SOC2 Type 2 and ISO27001 certified. Trusted by [Google](https://google.com), [Coinbase](https://coinbase.com), and [Composio](https://composio.dev). Stealth proxies, CAPTCHA solving, anti-fingerprinting, and full session isolation out of the box.
293
86
294
-
## Testing
87
+
AnchorBrowser handles the browser. declawed handles the rules.
295
88
296
-
61 tests covering the governance boundary: policy evaluation, deny-first ordering, Unicode bypass vectors, YAML validation, audit logging, budget enforcement, concurrent access, timer expiration, kill idempotency, and fail-closed behavior. AnchorBrowser is mocked because Shield's job is policy enforcement, not browser automation — if the browser fails, Shield fails closed.
89
+
[Get an API key →](https://anchorbrowser.io)
297
90
298
91
## Why This Exists
299
92
300
-
AI agents are getting credential access with zero governance. The OpenClaw credential leak showed what happens when agents operate without rules — 42,000 live credentials exposed. The community's workaround is buying separate hardware. That's expensive, fragile, and doesn't scale.
301
-
302
-
`declawed` gives agents what they should have had from the start: **a policy file, an audit log, and a kill switch.**
303
-
304
-
5 lines of YAML. One import. Zero new infrastructure.
93
+
AI agents are getting credential access with zero governance — 42,000 live credentials exposed, and the best workaround is buying separate hardware. `declawed` gives agents what they should have had from the start: **a policy file, an audit log, and a kill switch.**
305
94
306
95
Built by [Behalf](https://behalf-gray.vercel.app) — delegation governance for the agent era.
307
96
308
-
## Empowered by AnchorBrowser
309
-
310
-
declawed runs on [AnchorBrowser](https://anchorbrowser.io) — hardened, cloud-hosted browser sessions purpose-built for AI agents. [Cloudflare](https://cloudflare.com) verified bot partner. SOC2 Type 2 and ISO27001 certified. Trusted by [Google](https://google.com), [Coinbase](https://coinbase.com), and [Composio](https://composio.dev). Stealth proxies, CAPTCHA solving, anti-fingerprinting, and full session isolation out of the box.
311
-
312
-
AnchorBrowser handles the browser. declawed handles the rules.
0 commit comments