agentboot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/persona-request.md +62 -0
- package/.github/ISSUE_TEMPLATE/quality-feedback.md +67 -0
- package/.github/workflows/cla.yml +25 -0
- package/.github/workflows/validate.yml +49 -0
- package/.idea/agentboot.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CLA.md +98 -0
- package/CLAUDE.md +230 -0
- package/CONTRIBUTING.md +168 -0
- package/LICENSE +191 -0
- package/NOTICE +4 -0
- package/PERSONAS.md +156 -0
- package/README.md +172 -0
- package/agentboot.config.json +207 -0
- package/bin/agentboot.js +17 -0
- package/core/gotchas/README.md +35 -0
- package/core/instructions/baseline.instructions.md +133 -0
- package/core/instructions/security.instructions.md +186 -0
- package/core/personas/code-reviewer/SKILL.md +175 -0
- package/core/personas/code-reviewer/persona.config.json +11 -0
- package/core/personas/security-reviewer/SKILL.md +233 -0
- package/core/personas/security-reviewer/persona.config.json +11 -0
- package/core/personas/test-data-expert/SKILL.md +234 -0
- package/core/personas/test-data-expert/persona.config.json +10 -0
- package/core/personas/test-generator/SKILL.md +262 -0
- package/core/personas/test-generator/persona.config.json +10 -0
- package/core/traits/audit-trail.md +182 -0
- package/core/traits/confidence-signaling.md +172 -0
- package/core/traits/critical-thinking.md +129 -0
- package/core/traits/schema-awareness.md +132 -0
- package/core/traits/source-citation.md +174 -0
- package/core/traits/structured-output.md +199 -0
- package/docs/ci-cd-automation.md +548 -0
- package/docs/claude-code-reference/README.md +21 -0
- package/docs/claude-code-reference/agentboot-coverage.md +484 -0
- package/docs/claude-code-reference/feature-inventory.md +906 -0
- package/docs/cli-commands-audit.md +112 -0
- package/docs/cli-design.md +924 -0
- package/docs/concepts.md +1117 -0
- package/docs/config-schema-audit.md +121 -0
- package/docs/configuration.md +645 -0
- package/docs/delivery-methods.md +758 -0
- package/docs/developer-onboarding.md +342 -0
- package/docs/extending.md +448 -0
- package/docs/getting-started.md +298 -0
- package/docs/knowledge-layer.md +464 -0
- package/docs/marketplace.md +822 -0
- package/docs/org-connection.md +570 -0
- package/docs/plans/architecture.md +2429 -0
- package/docs/plans/design.md +2018 -0
- package/docs/plans/prd.md +1862 -0
- package/docs/plans/stack-rank.md +261 -0
- package/docs/plans/technical-spec.md +2755 -0
- package/docs/privacy-and-safety.md +807 -0
- package/docs/prompt-optimization.md +1071 -0
- package/docs/test-plan.md +972 -0
- package/docs/third-party-ecosystem.md +496 -0
- package/domains/compliance-template/README.md +173 -0
- package/domains/compliance-template/traits/compliance-aware.md +228 -0
- package/examples/enterprise/agentboot.config.json +184 -0
- package/examples/minimal/agentboot.config.json +46 -0
- package/package.json +63 -0
- package/repos.json +1 -0
- package/scripts/cli.ts +1069 -0
- package/scripts/compile.ts +1000 -0
- package/scripts/dev-sync.ts +149 -0
- package/scripts/lib/config.ts +137 -0
- package/scripts/lib/frontmatter.ts +61 -0
- package/scripts/sync.ts +687 -0
- package/scripts/validate.ts +421 -0
- package/tests/REGRESSION-PLAN.md +705 -0
- package/tests/TEST-PLAN.md +111 -0
- package/tests/cli.test.ts +705 -0
- package/tests/pipeline.test.ts +608 -0
- package/tests/validate.test.ts +278 -0
- package/tsconfig.json +62 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# Extending AgentBoot
|
|
2
|
+
|
|
3
|
+
AgentBoot ships generic. Your organization almost certainly has requirements that are
|
|
4
|
+
specific to your industry, your compliance regime, or your internal standards. This
|
|
5
|
+
document explains how to build a domain layer on top of AgentBoot core — without
|
|
6
|
+
modifying core, without forking the repository, and without coupling your proprietary
|
|
7
|
+
requirements to the public codebase.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## When to extend vs. when to contribute back
|
|
12
|
+
|
|
13
|
+
The rule is simple: if it is specific to your organization, extend. If it would be
|
|
14
|
+
useful to any team in your vertical, contribute back.
|
|
15
|
+
|
|
16
|
+
**Extend when:**
|
|
17
|
+
- The requirement is specific to your org's interpretation of a compliance standard,
|
|
18
|
+
not the standard itself.
|
|
19
|
+
- The requirement references your internal systems, internal terminology, or your
|
|
20
|
+
private codebase conventions.
|
|
21
|
+
- The persona or trait would only make sense to people who know your company.
|
|
22
|
+
|
|
23
|
+
**Contribute back when:**
|
|
24
|
+
- The trait is generic enough to apply to any team in your industry.
|
|
25
|
+
- The domain template would give other teams in your vertical a useful starting point.
|
|
26
|
+
- The bug fix or improvement applies to the core behavior that everyone uses.
|
|
27
|
+
|
|
28
|
+
When in doubt, start with an extension in your org personas repo. If it proves useful
|
|
29
|
+
enough that you find yourself wishing other teams could use it, open a contribution
|
|
30
|
+
proposal issue.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## The domain template structure
|
|
35
|
+
|
|
36
|
+
AgentBoot provides a domain template under `domains/compliance-template/` that shows
|
|
37
|
+
the structure of a domain layer. A domain layer is a directory that lives alongside
|
|
38
|
+
your `agentboot.config.json` (in your org personas repo) and adds to core without
|
|
39
|
+
replacing it.
|
|
40
|
+
|
|
41
|
+
A domain layer has this structure:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
domains/
|
|
45
|
+
my-domain/
|
|
46
|
+
README.md ← explains the domain, how to configure it
|
|
47
|
+
agentboot.domain.json ← domain manifest: name, version, traits, personas
|
|
48
|
+
traits/
|
|
49
|
+
my-domain-trait.md ← domain-specific trait definitions
|
|
50
|
+
personas/
|
|
51
|
+
my-domain-reviewer/
|
|
52
|
+
SKILL.md ← domain-specific persona
|
|
53
|
+
instructions/
|
|
54
|
+
always-on.md ← domain-level always-on instructions
|
|
55
|
+
path-scoped/
|
|
56
|
+
*.domain-file.md ← path-scoped instructions for sensitive file types
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The domain manifest (`agentboot.domain.json`) registers the domain with the build system:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"name": "my-domain",
|
|
64
|
+
"version": "1.0.0",
|
|
65
|
+
"description": "Domain layer for [your domain here]",
|
|
66
|
+
"traits": ["my-domain-trait"],
|
|
67
|
+
"personas": ["my-domain-reviewer"],
|
|
68
|
+
"requires_core_version": ">=1.0.0"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
To activate the domain, add it to your `agentboot.config.json`:
|
|
73
|
+
|
|
74
|
+
```jsonc
|
|
75
|
+
{
|
|
76
|
+
"extend": {
|
|
77
|
+
"domains": ["./domains/my-domain"]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## How to add a domain-specific trait
|
|
85
|
+
|
|
86
|
+
A domain-specific trait follows the exact same format as a core trait (see
|
|
87
|
+
`core/traits/critical-thinking.md` for the reference implementation). The difference
|
|
88
|
+
is that it lives in your domain layer and may reference domain-specific concepts.
|
|
89
|
+
|
|
90
|
+
**Example: adding an audit-logging awareness trait**
|
|
91
|
+
|
|
92
|
+
Suppose your domain requires that all database mutations emit audit log entries. You want
|
|
93
|
+
a trait that makes any reviewing persona aware of this requirement and flags violations.
|
|
94
|
+
|
|
95
|
+
Create `domains/my-domain/traits/audit-logging-awareness.md`:
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
# Trait: Audit Logging Awareness
|
|
99
|
+
|
|
100
|
+
**ID:** `audit-logging-awareness`
|
|
101
|
+
**Category:** Domain compliance
|
|
102
|
+
**Configurable:** No
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Overview
|
|
107
|
+
|
|
108
|
+
This trait makes a persona aware that all database mutations in [your domain] must emit
|
|
109
|
+
structured audit log entries. Any reviewing persona that composes this trait will flag
|
|
110
|
+
missing or malformed audit log calls.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Behavioral Directives
|
|
115
|
+
|
|
116
|
+
When reviewing code that performs database mutations:
|
|
117
|
+
|
|
118
|
+
- Verify that every INSERT, UPDATE, and DELETE is accompanied by an audit log call.
|
|
119
|
+
- Check that the audit log call captures: the actor (user/service identity), the
|
|
120
|
+
resource affected (table + primary key), the action type, and the timestamp.
|
|
121
|
+
- Flag any mutation that relies on a trigger or middleware for audit logging without
|
|
122
|
+
verifying that the trigger/middleware is in place for the affected table.
|
|
123
|
+
- Flag audit log calls that do not capture sufficient context to reconstruct the
|
|
124
|
+
state change.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Anti-Patterns to Avoid
|
|
129
|
+
|
|
130
|
+
- Do not flag read operations (SELECT). Audit requirements apply to mutations only.
|
|
131
|
+
- Do not assume audit logging is handled elsewhere without evidence.
|
|
132
|
+
- Do not accept "the framework handles this automatically" without verifying that the
|
|
133
|
+
framework is configured to do so for this specific table.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Interaction with Other Traits
|
|
138
|
+
|
|
139
|
+
- **`critical-thinking: HIGH`** — at HIGH weight, flag even cases where audit logging
|
|
140
|
+
is present but appears incomplete or inconsistent with other tables.
|
|
141
|
+
- **`source-citation`** — every audit finding must cite the specific line where the
|
|
142
|
+
mutation occurs and the specific line (or lack thereof) where audit logging is absent.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then declare the trait in your domain manifest and compose it into your domain personas.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## How to add a domain-specific persona
|
|
150
|
+
|
|
151
|
+
A domain persona follows the same SKILL.md format as a core persona. The difference is
|
|
152
|
+
that its system prompt can reference your domain's specific requirements, terminology,
|
|
153
|
+
and standards — because it lives in your domain layer, not in core.
|
|
154
|
+
|
|
155
|
+
**Example: adding a compliance reviewer**
|
|
156
|
+
|
|
157
|
+
Create `domains/my-domain/personas/compliance-reviewer/SKILL.md`:
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
---
|
|
161
|
+
id: compliance-review
|
|
162
|
+
name: Compliance Reviewer
|
|
163
|
+
version: 1.0.0
|
|
164
|
+
traits:
|
|
165
|
+
critical-thinking: HIGH
|
|
166
|
+
structured-output: true
|
|
167
|
+
source-citation: true
|
|
168
|
+
audit-logging-awareness: true
|
|
169
|
+
scope: pr
|
|
170
|
+
output_format: structured
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
You are the compliance reviewer for [your domain]. Your mandate is to verify that
|
|
174
|
+
code changes conform to [your domain]'s compliance requirements before they merge.
|
|
175
|
+
|
|
176
|
+
[Your domain-specific system prompt here. Describe the compliance context, the
|
|
177
|
+
specific requirements the persona should enforce, and the scope of review.]
|
|
178
|
+
|
|
179
|
+
## Output Schema
|
|
180
|
+
|
|
181
|
+
...
|
|
182
|
+
|
|
183
|
+
## What Not To Do
|
|
184
|
+
|
|
185
|
+
...
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## How to add path-scoped instructions for sensitive file types
|
|
191
|
+
|
|
192
|
+
Path-scoped instructions activate only when the user's working context involves matching
|
|
193
|
+
file patterns. They are one of the most powerful features in AgentBoot because they let
|
|
194
|
+
you add domain-specific guidance exactly where it is needed without polluting every
|
|
195
|
+
interaction.
|
|
196
|
+
|
|
197
|
+
Create a file in `domains/my-domain/instructions/path-scoped/`. The filename determines
|
|
198
|
+
the glob pattern that activates the instruction:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
path-scoped/
|
|
202
|
+
*.migration.sql.md ← activates when the user is working on migration files
|
|
203
|
+
config/secrets*.md ← activates when working in the secrets config directory
|
|
204
|
+
api/*/handlers/*.md ← activates when working on API handler files
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The content of the file is an instruction fragment that is prepended to the system prompt
|
|
208
|
+
when the path pattern matches. Keep it focused and specific — path-scoped instructions
|
|
209
|
+
should add exactly the context that matters for that file type, not general guidance.
|
|
210
|
+
|
|
211
|
+
Example `domains/my-domain/instructions/path-scoped/*.migration.sql.md`:
|
|
212
|
+
|
|
213
|
+
```markdown
|
|
214
|
+
## Database Migration Context
|
|
215
|
+
|
|
216
|
+
You are working on a database migration file for [your domain].
|
|
217
|
+
|
|
218
|
+
Migrations in this domain must:
|
|
219
|
+
- [List your domain-specific migration requirements here]
|
|
220
|
+
|
|
221
|
+
Before suggesting any migration change, verify:
|
|
222
|
+
- [Your pre-migration verification checklist]
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## How org-level customization works
|
|
228
|
+
|
|
229
|
+
The `extend` field in `agentboot.config.json` is the integration point for all
|
|
230
|
+
customization. It can reference:
|
|
231
|
+
|
|
232
|
+
- Local directories (relative to `agentboot.config.json`): `"./personas"`, `"./domains/my-domain"`
|
|
233
|
+
- Domain manifests: an array of domain paths, each resolved and merged in order
|
|
234
|
+
|
|
235
|
+
```jsonc
|
|
236
|
+
{
|
|
237
|
+
"org": "my-org",
|
|
238
|
+
"personas": {
|
|
239
|
+
"enabled": ["code-reviewer", "security-reviewer", "test-generator"],
|
|
240
|
+
"extend": "./personas"
|
|
241
|
+
},
|
|
242
|
+
"extend": {
|
|
243
|
+
"domains": [
|
|
244
|
+
"./domains/my-domain",
|
|
245
|
+
"./domains/my-second-domain"
|
|
246
|
+
],
|
|
247
|
+
"instructions": "./instructions/org-always-on.md"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Precedence rules for `extend`:**
|
|
253
|
+
1. Core traits and personas form the base.
|
|
254
|
+
2. Domain layers are applied in the order listed. Later domains can add to but not
|
|
255
|
+
remove core traits or personas.
|
|
256
|
+
3. The `personas.extend` directory adds org-specific personas on top of domain layers.
|
|
257
|
+
4. Team-level configuration (scoped via group/team in `repos.json`) layers on top of
|
|
258
|
+
all of the above for repos in that team.
|
|
259
|
+
|
|
260
|
+
Nothing in a domain layer can disable a core trait or persona that a higher scope has
|
|
261
|
+
marked required. Extensions add; they do not subtract. This is the guarantee that
|
|
262
|
+
org-level governance always propagates downward.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Per-persona extensions
|
|
267
|
+
|
|
268
|
+
Domain layers can extend individual personas without modifying the base definition. This
|
|
269
|
+
is the "extend without modify" pattern — critical for multi-product organizations where
|
|
270
|
+
each product has specific requirements that should layer on top of the generic persona.
|
|
271
|
+
|
|
272
|
+
Create an extension file at `domains/my-domain/extensions/{persona-name}.md`:
|
|
273
|
+
|
|
274
|
+
```markdown
|
|
275
|
+
## Additional Review Rules (My Domain)
|
|
276
|
+
|
|
277
|
+
When reviewing code in this domain, also check for:
|
|
278
|
+
|
|
279
|
+
- All API endpoints must validate the `X-Tenant-ID` header before processing
|
|
280
|
+
- Database connections must use the read replica for GET endpoints
|
|
281
|
+
- Event payloads must include `correlationId` for distributed tracing
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The persona reads its extension file during the Setup phase (before beginning review).
|
|
285
|
+
Extension rules **add to** the base persona's rules — they do not replace them. If an
|
|
286
|
+
extension rule conflicts with a base rule, the extension is ignored and the conflict
|
|
287
|
+
is logged.
|
|
288
|
+
|
|
289
|
+
This pattern was validated in a production implementation, where product-level
|
|
290
|
+
extensions added HIPAA-specific checks to the generic code reviewer, security
|
|
291
|
+
reviewer, and test data expert without changing any base agent definitions.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## How to add gotchas rules
|
|
296
|
+
|
|
297
|
+
Gotchas rules are path-scoped instructions that encode battle-tested operational
|
|
298
|
+
knowledge. They are the single highest-value extension you can add — developers
|
|
299
|
+
immediately see value when the agent warns them about a pitfall they would have hit.
|
|
300
|
+
|
|
301
|
+
Create gotchas files in `domains/my-domain/instructions/path-scoped/`:
|
|
302
|
+
|
|
303
|
+
```markdown
|
|
304
|
+
---
|
|
305
|
+
paths:
|
|
306
|
+
- "**/*.lambda.ts"
|
|
307
|
+
- "functions/**"
|
|
308
|
+
description: "Lambda deployment gotchas"
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
# Lambda Gotchas
|
|
312
|
+
|
|
313
|
+
- **Cold start penalty scales with bundle size.** Keep handler files under 5MB.
|
|
314
|
+
Tree-shake aggressively. Do not import the entire AWS SDK — import only the
|
|
315
|
+
client you need (`@aws-sdk/client-s3`, not `aws-sdk`).
|
|
316
|
+
- **Environment variables are NOT encrypted at rest by default.** Use SSM
|
|
317
|
+
Parameter Store or Secrets Manager for anything sensitive. Never put API keys
|
|
318
|
+
in Lambda env vars directly.
|
|
319
|
+
- **Timeout default is 3 seconds.** If your handler does any I/O, set timeout
|
|
320
|
+
explicitly. A timed-out Lambda still gets billed for the full duration.
|
|
321
|
+
- **Do not use `console.log` with objects in production.** Use structured logging
|
|
322
|
+
(`JSON.stringify` with defined fields) or the Lambda Powertools logger.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Sources for gotchas:
|
|
326
|
+
- Post-incident reviews ("what did we learn?")
|
|
327
|
+
- Onboarding notes ("what I wish I knew")
|
|
328
|
+
- Code review comments that keep repeating the same feedback
|
|
329
|
+
- Production debugging sessions where the root cause was non-obvious
|
|
330
|
+
|
|
331
|
+
The best gotchas rules are specific, actionable, and explain *why* — not just *what*.
|
|
332
|
+
"Don't do X" is less useful than "Don't do X because Y will happen, and here's how
|
|
333
|
+
to verify you haven't done it."
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## How to add compliance hooks
|
|
338
|
+
|
|
339
|
+
For organizations with compliance requirements (HIPAA, SOC 2, PCI DSS, GDPR),
|
|
340
|
+
AgentBoot supports a defense-in-depth hook model. See
|
|
341
|
+
[`docs/concepts.md`](concepts.md#compliance-hooks) for the three-layer model.
|
|
342
|
+
|
|
343
|
+
To add compliance hooks to your domain:
|
|
344
|
+
|
|
345
|
+
1. Create the hook script in `domains/my-domain/hooks/`:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
#!/bin/bash
|
|
349
|
+
# hooks/sensitive-data-scan.sh
|
|
350
|
+
# Exit 2 = block request, Exit 0 = allow
|
|
351
|
+
|
|
352
|
+
INPUT="$1"
|
|
353
|
+
|
|
354
|
+
# Patterns to detect
|
|
355
|
+
if echo "$INPUT" | grep -qE '\b\d{3}-\d{2}-\d{4}\b'; then
|
|
356
|
+
echo '{"error": "SSN pattern detected. Remove before continuing."}' >&2
|
|
357
|
+
exit 2
|
|
358
|
+
fi
|
|
359
|
+
if echo "$INPUT" | grep -qE '\b(sk|pk)_(live|test)_[A-Za-z0-9]{24,}\b'; then
|
|
360
|
+
echo '{"error": "API key detected. Remove before continuing."}' >&2
|
|
361
|
+
exit 2
|
|
362
|
+
fi
|
|
363
|
+
exit 0
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
2. Create a hook configuration fragment in `domains/my-domain/hooks/settings.json`
|
|
367
|
+
that the build system merges into each target repo's `.claude/settings.json`:
|
|
368
|
+
|
|
369
|
+
```json
|
|
370
|
+
{
|
|
371
|
+
"hooks": {
|
|
372
|
+
"UserPromptSubmit": [
|
|
373
|
+
{
|
|
374
|
+
"matcher": "",
|
|
375
|
+
"hooks": [
|
|
376
|
+
{
|
|
377
|
+
"type": "command",
|
|
378
|
+
"command": ".claude/hooks/sensitive-data-scan.sh",
|
|
379
|
+
"timeout": 5000
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"Stop": [
|
|
385
|
+
{
|
|
386
|
+
"matcher": "",
|
|
387
|
+
"hooks": [
|
|
388
|
+
{
|
|
389
|
+
"type": "command",
|
|
390
|
+
"command": ".claude/hooks/sensitive-data-output-scan.sh"
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Claude Code supports a comprehensive set of hook events. The most relevant for compliance:
|
|
400
|
+
- `UserPromptSubmit` — scan input before the model sees it (Layer 1, deterministic)
|
|
401
|
+
- `PreToolUse` — intercept specific tool calls (e.g., block `Bash(rm -rf *)`)
|
|
402
|
+
- `PostToolUse` — scan tool output for sensitive data
|
|
403
|
+
- `Stop` — scan model output (Layer 3, advisory — fires after render)
|
|
404
|
+
- `SessionStart` — audit logging of session initiation
|
|
405
|
+
|
|
406
|
+
3. Create the corresponding always-on instruction in
|
|
407
|
+
`domains/my-domain/instructions/always-on.md` (the Layer 2 advisory control):
|
|
408
|
+
|
|
409
|
+
```markdown
|
|
410
|
+
## Sensitive Data Policy
|
|
411
|
+
|
|
412
|
+
You must never process, store, or output real customer data, personally identifiable
|
|
413
|
+
information, production credentials, or internal API keys. If user input appears to
|
|
414
|
+
contain any of these, stop immediately, explain what you detected, and ask the user
|
|
415
|
+
to remove it before continuing.
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
4. For HARD guardrails (non-overridable), generate managed settings artifacts in
|
|
419
|
+
`domains/my-domain/managed/` for MDM deployment:
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
managed/
|
|
423
|
+
managed-settings.json → /Library/Application Support/ClaudeCode/ (macOS)
|
|
424
|
+
managed-mcp.json → /Library/Application Support/ClaudeCode/ (macOS)
|
|
425
|
+
CLAUDE.md → /Library/Application Support/ClaudeCode/ (macOS)
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Managed settings cannot be overridden by any project or user configuration. This is
|
|
429
|
+
the native Claude Code mechanism for HARD guardrails.
|
|
430
|
+
|
|
431
|
+
5. Document the honest limitations — which platforms enforce deterministically vs.
|
|
432
|
+
advisory-only. This transparency builds trust with compliance teams.
|
|
433
|
+
|
|
434
|
+
**Platform support matrix:**
|
|
435
|
+
|
|
436
|
+
| Layer | Claude Code | Copilot CLI | IDE (VS Code/IntelliJ) |
|
|
437
|
+
|-------|-------------|-------------|------------------------|
|
|
438
|
+
| Input hook (deterministic) | `UserPromptSubmit` | Pre-prompt hook | Not available |
|
|
439
|
+
| Instruction refusal (advisory) | CLAUDE.md | copilot-instructions.md | copilot-instructions.md |
|
|
440
|
+
| Output hook (advisory) | `Stop` | Not available | Not available |
|
|
441
|
+
| Managed settings (HARD) | MDM paths | Not available | Not available |
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
*See also:*
|
|
446
|
+
- [`docs/concepts.md`](concepts.md) — the scope hierarchy and trait system explained
|
|
447
|
+
- [`docs/configuration.md`](configuration.md) — complete `agentboot.config.json` reference
|
|
448
|
+
- [`domains/compliance-template/README.md`](../domains/compliance-template/README.md) — worked example domain template
|