@oneie/claude 0.8.0 → 0.10.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/.claude-plugin/plugin.json +1 -1
- package/agents/abm-strategist.md +67 -1
- package/agents/ads-meta.md +67 -1
- package/agents/analyst.md +67 -1
- package/agents/animator.md +108 -0
- package/agents/architect.md +269 -20
- package/agents/brand-guardian.md +67 -1
- package/agents/brand-strategist.md +67 -1
- package/agents/campaign-content.md +67 -1
- package/agents/campaign-email.md +67 -1
- package/agents/campaign-sms.md +67 -1
- package/agents/campaign-social.md +67 -1
- package/agents/cco.md +83 -2
- package/agents/ceo.md +108 -11
- package/agents/chairman.md +197 -0
- package/agents/cmo.md +82 -2
- package/agents/community-greeter.md +67 -1
- package/agents/community-moderator.md +67 -1
- package/agents/compliance.md +67 -1
- package/agents/copywriter.md +67 -1
- package/agents/creative-strategist.md +67 -1
- package/agents/cro.md +81 -1
- package/agents/cto.md +266 -28
- package/agents/customer-interviewer.md +67 -1
- package/agents/customer-researcher.md +67 -1
- package/agents/customer-success-manager.md +67 -1
- package/agents/customer-trainer.md +67 -1
- package/agents/cxo.md +82 -1
- package/agents/demand-creator.md +67 -1
- package/agents/demo-mover.md +67 -1
- package/agents/demo-specialist.md +67 -1
- package/agents/demo-thai-family-law.md +67 -1
- package/agents/designer.md +67 -1
- package/agents/discovery-caller.md +67 -1
- package/agents/doctor.md +269 -0
- package/agents/educate-coach.md +67 -1
- package/agents/elevate-tutor.md +67 -1
- package/agents/email-lifecycle-marketer.md +67 -1
- package/agents/engage-specialist.md +67 -1
- package/agents/events-coordinator.md +67 -1
- package/agents/foundation-builder.md +67 -1
- package/agents/funnel-architect.md +67 -1
- package/agents/gift-creator.md +67 -1
- package/agents/google-ads.md +67 -1
- package/agents/guide.md +67 -1
- package/agents/helpdesk-dispatcher.md +67 -1
- package/agents/hook-specialist.md +67 -1
- package/agents/identify-optimizer.md +67 -1
- package/agents/implementer.md +313 -45
- package/agents/incident-commander.md +67 -1
- package/agents/insights-lead.md +87 -1
- package/agents/journey-runner.md +67 -1
- package/agents/linkedin-ads.md +67 -1
- package/agents/live-sales-chat.md +67 -1
- package/agents/market-researcher.md +67 -1
- package/agents/media-buyer.md +67 -1
- package/agents/memory-keeper.md +195 -0
- package/agents/movers-customer-researcher.md +67 -1
- package/agents/movers-foundation-builder.md +67 -1
- package/agents/movers-market-researcher.md +67 -1
- package/agents/movers-pricing-strategist.md +67 -1
- package/agents/nurture-architect.md +67 -1
- package/agents/offer-architect.md +67 -1
- package/agents/onboarder.md +67 -1
- package/agents/onboarding-specialist.md +67 -1
- package/agents/operations-dashboard.md +87 -1
- package/agents/perf-engineer.md +333 -37
- package/agents/playbook-writer.md +67 -1
- package/agents/plg-strategist.md +67 -1
- package/agents/positioning-architect.md +67 -1
- package/agents/press-officer.md +67 -1
- package/agents/pricing-strategist.md +67 -1
- package/agents/privacy-officer.md +67 -1
- package/agents/referral-manager.md +67 -1
- package/agents/refine-analyst.md +67 -1
- package/agents/release-manager.md +446 -39
- package/agents/renewals-upsell-rep.md +67 -1
- package/agents/review-engineer.md +319 -45
- package/agents/rewards-steward.md +67 -1
- package/agents/sales-call-coach.md +67 -1
- package/agents/sales-closer.md +67 -1
- package/agents/security-auditor.md +343 -48
- package/agents/sell-closer.md +67 -1
- package/agents/share-amplifier.md +67 -1
- package/agents/social-media-manager.md +67 -1
- package/agents/storyteller.md +301 -0
- package/agents/strategist.md +67 -1
- package/agents/strategy-aligner.md +67 -1
- package/agents/support-agent.md +67 -1
- package/agents/tagger.md +327 -0
- package/agents/tech-writer.md +195 -22
- package/agents/test-engineer.md +398 -29
- package/agents/tiktok-ads.md +67 -1
- package/agents/tracking-engineer.md +67 -1
- package/agents/trailkeeper.md +181 -0
- package/agents/upsell-strategist.md +67 -1
- package/agents/voice.md +67 -1
- package/agents/w1-recon.md +1 -1
- package/agents/w2-decide.md +1 -1
- package/agents/w3-edit.md +8 -2
- package/agents/w4-verify.md +13 -0
- package/agents/workflow-optimiser.md +81 -1
- package/commands/close.md +916 -160
- package/commands/deploy.md +102 -724
- package/commands/do.md +58 -2
- package/commands/sweep.md +159 -0
- package/commands/tasks.md +222 -0
- package/hooks/scripts/dev-only.sh +135 -0
- package/hooks/scripts/git-add-guard.sh +37 -2
- package/hooks/scripts/session-start.sh +32 -4
- package/package.json +1 -1
- package/rules/scripts.md +85 -0
- package/scripts/CLAUDE.md +315 -0
- package/scripts/ad-copy-lint.sh +656 -0
- package/scripts/agent-actor-parity.sh +129 -0
- package/scripts/blocks-manifest-cached.sh +100 -0
- package/scripts/chat-context-check.sh +89 -0
- package/scripts/chrome.mjs +18 -0
- package/scripts/close-metrics.sh +587 -0
- package/scripts/close-owner.sh +326 -0
- package/scripts/db-sync-lock-check.sh +116 -0
- package/scripts/deploy-emit.sh +311 -0
- package/scripts/deploy-gate-check.sh +155 -0
- package/scripts/deploy-ready.sh +78 -0
- package/scripts/deploy-record.sh +605 -0
- package/scripts/deploy-schema-check.sh +58 -0
- package/scripts/deploy.sh +393 -243
- package/scripts/do-auto.sh +127 -26
- package/scripts/do-board.sh +429 -0
- package/scripts/do-close.sh +1184 -0
- package/scripts/do-consumer-sweep.sh +18 -1
- package/scripts/do-decide.sh +476 -0
- package/scripts/do-fleet.sh +8 -2
- package/scripts/do-plan-json.mjs +110 -12
- package/scripts/do-prove-selftest.sh +108 -0
- package/scripts/do-prove.sh +86 -10
- package/scripts/do-rank.py +200 -3
- package/scripts/do-reconcile.sh +73 -12
- package/scripts/do-signal.sh +101 -23
- package/scripts/do-smoke.sh +18 -1
- package/scripts/do-w4-gates.sh +11 -1
- package/scripts/do-world-check.sh +153 -0
- package/scripts/download-stats.sh +172 -0
- package/scripts/factory-brief-check.sh +330 -0
- package/scripts/factory-check.sh +18 -1
- package/scripts/factory-close-check.sh +257 -0
- package/scripts/factory-emit.sh +211 -0
- package/scripts/factory-executor-check.mjs +353 -0
- package/scripts/factory-peak.sh +301 -0
- package/scripts/factory-repo.sh +71 -0
- package/scripts/factory-review-check.mjs +61 -0
- package/scripts/factory-tasks-check.sh +18 -1
- package/scripts/fixtures/factory-brief-real.md +44 -0
- package/scripts/flywheel-outcome.sh +63 -0
- package/scripts/gate-reaper-check.sh +98 -0
- package/scripts/gate-reaper.sh +9 -0
- package/scripts/gate-watchdog.sh +619 -0
- package/scripts/gc-content-check.sh +142 -0
- package/scripts/gh-traffic-capture.sh +153 -0
- package/scripts/govern-order-check.sh +202 -0
- package/scripts/governor-doors-check.sh +86 -5
- package/scripts/health.sh +448 -0
- package/scripts/id-inventory.mjs +418 -0
- package/scripts/incident.sh +212 -0
- package/scripts/land.sh +755 -45
- package/scripts/lib/gc-finished.sh +77 -0
- package/scripts/livekit-ratchet.sh +18 -1
- package/scripts/machine-check.sh +1 -1
- package/scripts/memory-index-budget.sh +79 -0
- package/scripts/npm-downloads.sh +109 -0
- package/scripts/one-agents.mjs +204 -8
- package/scripts/one-resume.sh +31 -3
- package/scripts/pr-body.sh +335 -0
- package/scripts/preview-fd-check.sh +289 -0
- package/scripts/redirect-lint.sh +169 -0
- package/scripts/release.sh +40 -6
- package/scripts/resume-lost-sessions.sh +68 -0
- package/scripts/shoot-pages.mjs +140 -0
- package/scripts/signal-meta-backfill.ts +451 -0
- package/scripts/signal-watch.sh +63 -6
- package/scripts/speed-cache-check.sh +12 -2
- package/scripts/sweep.sh +426 -0
- package/scripts/task-titles-dump.ts +101 -0
- package/scripts/test-cached.sh +47 -10
- package/scripts/test-lanes.sh +14 -0
- package/scripts/thread-name-backfill.ts +215 -0
- package/scripts/triage-shape-check.sh +149 -0
- package/scripts/tsc-cached.sh +155 -8
- package/scripts/typedb-flake-check.sh +3 -1
- package/scripts/urls-lint.sh +8 -0
- package/scripts/verify-board-doors.sh +80 -0
- package/scripts/verify-fast.sh +159 -6
- package/scripts/worktree-up.sh +21 -3
- package/skills/astro/SKILL.md +9 -3
- package/skills/astro/optimize-performance.md +3 -2
- package/skills/cloudflare/SKILL.md +3 -2
- package/skills/cloudflare-security-audit/AI-AND-LLM.md +83 -0
- package/skills/cloudflare-security-audit/ATTACK-CLASSES.md +130 -0
- package/skills/cloudflare-security-audit/CLIENT-SIDE.md +83 -0
- package/skills/cloudflare-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
- package/skills/cloudflare-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
- package/skills/cloudflare-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
- package/skills/cloudflare-security-audit/HUNTING.md +251 -0
- package/skills/cloudflare-security-audit/LICENSE +21 -0
- package/skills/cloudflare-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
- package/skills/cloudflare-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
- package/skills/cloudflare-security-audit/PROVENANCE.md +78 -0
- package/skills/cloudflare-security-audit/RECONNAISSANCE.md +156 -0
- package/skills/cloudflare-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
- package/skills/cloudflare-security-audit/SKILL.md +192 -0
- package/skills/cloudflare-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
- package/skills/cloudflare-security-audit/VALIDATION-AND-REPORTING.md +186 -0
- package/skills/cloudflare-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
- package/skills/cloudflare-security-audit/report-schema.json +461 -0
- package/skills/cloudflare-security-audit/validate-coverage-ledger.cjs +872 -0
- package/skills/cloudflare-security-audit/validate-coverage-ledger.test.cjs +740 -0
- package/skills/cloudflare-security-audit/validate-findings.cjs +773 -0
- package/skills/cloudflare-security-audit/validate-findings.test.cjs +652 -0
- package/skills/deploy/REFERENCE.md +713 -0
- package/skills/deploy/SKILL.md +140 -0
- package/skills/fleet-audit/SKILL.md +58 -0
- package/skills/meeting/SKILL.md +220 -0
- package/skills/planning/SKILL.md +256 -0
- package/skills/shadcn/SKILL.md +1 -1
- package/skills/typedb/SKILL.md +7 -0
- package/skills/voice/SKILL.md +94 -6
- package/skills/voice/corpus-check.sh +87 -0
- package/templates/template-agent.md +7 -1
- package/templates/template-feature.md +9 -0
- package/templates/template-todo.md +29 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# PROVENANCE — vendored, not ours
|
|
2
|
+
|
|
3
|
+
This directory is **generated output from an external repository**, copied verbatim
|
|
4
|
+
except for the two deltas recorded below. Do not hand-edit it. To take an upstream
|
|
5
|
+
change: re-clone, re-copy, re-apply the deltas, and update the sha here.
|
|
6
|
+
|
|
7
|
+
| | |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Upstream | https://github.com/cloudflare/security-audit-skill |
|
|
10
|
+
| Path taken | `skills/security-audit/` (all 20 files) + root `LICENSE` |
|
|
11
|
+
| Commit | `c1c8a8c1471069fb0e188eeaff69b8e8db6564a8` |
|
|
12
|
+
| Commit date | 2026-09-14T20:28:54+01:00 |
|
|
13
|
+
| Vendored | 2026-09-17 |
|
|
14
|
+
| Licence | MIT — Copyright (c) 2025-2026 Cloudflare, Inc. (`LICENSE`, in this directory) |
|
|
15
|
+
|
|
16
|
+
`.claude/` mirrors to github.com/one-ie/claude, so the MIT notice travels inside
|
|
17
|
+
this directory rather than only at the clone root.
|
|
18
|
+
|
|
19
|
+
## Verify it is still verbatim
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone --depth 1 https://github.com/cloudflare/security-audit-skill /tmp/cfsec
|
|
23
|
+
diff -r /tmp/cfsec/skills/security-audit .claude/skills/cloudflare-security-audit \
|
|
24
|
+
--exclude PROVENANCE.md --exclude LICENSE
|
|
25
|
+
# expected: ONE hunk, the SKILL.md frontmatter (the two deltas below). Anything
|
|
26
|
+
# else is either an upstream change to take, or a hand-edit to revert.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## The two deltas, and why
|
|
30
|
+
|
|
31
|
+
1. **`name: security-audit` → `name: cloudflare-security-audit`.** A skill's `name`
|
|
32
|
+
must match its directory, and the directory could not be `security-audit`:
|
|
33
|
+
`one.ie/ai/skills/security-audit/SKILL.md` already holds that name and is loaded
|
|
34
|
+
by that exact path from `one.ie/ai/agents/security-auditor/agent.md`.
|
|
35
|
+
|
|
36
|
+
2. **`description` narrowed to whole-repo / third-party audits**, with an explicit
|
|
37
|
+
pointer to ONE's own skill for everything else. The upstream description fires on
|
|
38
|
+
"security questions, focused reviews, … or pen tests" — i.e. on a routine "is this
|
|
39
|
+
secure?". That is the ONE question, and answering it out of this file would hand
|
|
40
|
+
the reader a doctrine that *forbids* probing deployed endpoints. Which brings us to:
|
|
41
|
+
|
|
42
|
+
## The doctrine conflict — read this before loading the skill
|
|
43
|
+
|
|
44
|
+
The two skills disagree, on purpose, and the disagreement is load-bearing.
|
|
45
|
+
|
|
46
|
+
| | Cloudflare (this skill) | ONE (`one.ie/ai/skills/security-audit/SKILL.md`) |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| Target | somebody else's repo, assumed hostile | our own estate, assumed honest-but-silent |
|
|
49
|
+
| Evidence | source trace + a sandboxed fixture | a live probe from where the code runs |
|
|
50
|
+
| Deployed endpoints | **do not probe** | **probe, or you have proven nothing** |
|
|
51
|
+
| Running target code | only inside an OS-enforced sandbox | n/a |
|
|
52
|
+
| Output | `findings.json` + `REPORT.md` under `~/security-audit-skill/<repo>/run-N` | `{refuted, findings}`, or a compact report |
|
|
53
|
+
|
|
54
|
+
**Neither overrides the other. They are scoped by target:**
|
|
55
|
+
|
|
56
|
+
- **Running target-controlled code, or auditing a third-party / untrusted repo** →
|
|
57
|
+
Cloudflare's sandbox envelope governs, in full. Every control it names, or you do
|
|
58
|
+
not execute.
|
|
59
|
+
- **ONE's own deployed surfaces** → ONE's live-probe rule governs, unchanged and
|
|
60
|
+
still mandatory. Every launch-blocking finding on record came from a live probe;
|
|
61
|
+
not one would have been caught by reading. Reading the source and finding nothing
|
|
62
|
+
wrong remains a refusal, not a clearance.
|
|
63
|
+
|
|
64
|
+
Taking Cloudflare's "do not probe deployed endpoints" as a general rule would delete
|
|
65
|
+
the one rule that has ever found anything here — a regression wearing an upgrade's
|
|
66
|
+
clothes.
|
|
67
|
+
|
|
68
|
+
## Mode, before you run it
|
|
69
|
+
|
|
70
|
+
The skill has two modes and says loading it authorizes neither.
|
|
71
|
+
|
|
72
|
+
- **Guidance mode** — the default, and the only mode on a review-lens turn. Use the
|
|
73
|
+
relevant parts; write no files, create no output directory, run no six-phase
|
|
74
|
+
workflow. A lens returns `REVIEW_SCHEMA` `{refuted, findings}`; the factory
|
|
75
|
+
executor's `votes.flatMap` cannot read a `REPORT.md`.
|
|
76
|
+
- **Full audit mode** — only when a person or `cto` calls it in by hand for a repo
|
|
77
|
+
audit or pen test. It orchestrates subagent fleets and writes a run directory
|
|
78
|
+
outside the target.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Reconnaissance
|
|
2
|
+
|
|
3
|
+
### Phase 1: Map the source and plan coverage
|
|
4
|
+
|
|
5
|
+
The parent initializes `run-metadata.json`, applies the strict pre-reconnaissance budget gate in `SKILL.md`, then creates agent scratch roots and the shared ledger before hunting. If the gate fails, record the incomplete status in metadata and launch no reconnaissance agent. Reconnaissance reads the target and locally available build/configuration state only. It does not contact deployed endpoints, external identity providers, registries, brokers, cloud APIs, or other shared services.
|
|
6
|
+
|
|
7
|
+
Launch several `research` agents in parallel. They return structured facts to the parent and do not write files.
|
|
8
|
+
|
|
9
|
+
**Agent 1a: Product, stack, and local operation**
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Read the target at <target>. Do not use network access. Return:
|
|
13
|
+
1. Product type, users, operators, and ordinary trust-sensitive actions.
|
|
14
|
+
2. Languages, frameworks, build system, runtimes, and locally visible deployment models.
|
|
15
|
+
3. Repository-relative entry points and subsystem boundaries.
|
|
16
|
+
4. Exact build and test commands that could run offline with local dependencies, their expected write locations, and the target-controlled inputs they process. Do not run them during reconnaissance.
|
|
17
|
+
5. Comparable software or protocol visible from local documentation and dependencies. If no useful comparison is source-grounded, say so.
|
|
18
|
+
6. Missing local toolchains or runtime facts that limit bounded execution.
|
|
19
|
+
Return only source facts with repository-relative file:line references.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Agent 1b: Principals, authority, and controls**
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Read all source that establishes identity, authorization, isolation, and privilege. Map:
|
|
26
|
+
1. Each lower-trust principal and the actions it has by design.
|
|
27
|
+
2. Authentication or peer identity at each entry surface.
|
|
28
|
+
3. Per-resource authorization and tenant/owner scope.
|
|
29
|
+
4. Process, browser, workload, CI, plugin, model/tool, device, or local-IPC authority.
|
|
30
|
+
5. Privilege changes, confirmation, revocation, recovery, and fallback paths.
|
|
31
|
+
6. Which controls are source-visible and which depend on an unobserved deployment fact.
|
|
32
|
+
Return trust boundaries and control locations with repository-relative file:line references. Do not infer live reachability.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Agent 1c: Entry surfaces, copies, and sinks**
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Inventory every source-visible place external or lower-trust input enters:
|
|
39
|
+
- HTTP/browser, RPC/message/protocol, files/archive/document, CLI/env/config, plugins/dependencies/CI, cloud events/IAM selectors, model context/tool arguments, mobile/deep-link/webview, and local IPC.
|
|
40
|
+
For each surface, follow major transformations, stored or derived copies, and security-relevant sinks. Record source-visible limits and parallel paths to the same effect.
|
|
41
|
+
Return repository-relative paths and line numbers. Be complete, but do not execute or send inputs.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Agent 1d: Local execution and deployment visibility**
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Read tests, build definitions, manifests, packaging, and maintained environment overlays. Return:
|
|
48
|
+
1. Small offline tests or existing fixtures that could validate trust boundaries with dummy data inside the required OS-enforced sandbox.
|
|
49
|
+
2. Processes that could use an isolated loopback network namespace without external or shared dependencies.
|
|
50
|
+
3. Commands that would fetch dependencies, publish artifacts, contact paid/provider APIs, or affect shared state; mark them prohibited for this run.
|
|
51
|
+
4. Deployed controls and attachments that source cannot establish and therefore require needs_validation if decisive.
|
|
52
|
+
5. The final active source path for each deployment mode only where the repository selects it deterministically.
|
|
53
|
+
6. Whether the local platform can enforce an empty allowlisted environment, no external network, read-only target/toolchain mounts, scratch-only writes, and explicit CPU, memory, process, file-size, disk, and wall-clock limits. Missing controls block target-controlled execution.
|
|
54
|
+
7. Whether trusted parent-side code can promote predeclared scratch files with path-confined no-follow descriptor traversal, nonblocking regular-file checks, no-follow traversal of every destination parent, exclusive regular-file destination creation, and explicit per-file and cumulative size bounds. Missing promotion controls block use of scratch files as evidence.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add focused reconnaissance agents for materially distinct deployment modes or subsystems that these four do not map. Do not silently omit them: if the budget gate in `SKILL.md` blocks a focused agent, launch nothing for it, seed the unmapped area as a `deferred` ledger unit with reason `budget_cannot_reserve_critics_and_validation`, and disclose the gap in the report.
|
|
58
|
+
|
|
59
|
+
## Prior-run input
|
|
60
|
+
|
|
61
|
+
Before selecting work, the parent reads every available prior `coverage-ledger.json` and `findings.json` for the same repo:
|
|
62
|
+
|
|
63
|
+
- Compare the source locations, controls, conditions, and source-derived identity for every prior record and unit against the current source.
|
|
64
|
+
- Carry an unchanged prior `confirmed` record into the current candidate set, with the same fingerprint, only when its relevant source, conditions, and qualifying evidence still apply. Link it to a current `planned` unit with `prior_status: "prior_confirmed_same_source"` and put only that root cause on the hunter exclusion list. The Phase 3 verifier that re-verifies the carried record becomes that unit's assignment owner; its source re-check is the unit's first check and moves the unit to `candidate` with the carried fingerprint.
|
|
65
|
+
- Build a current planned `prior_confirmed_changed_source` revalidation unit when any relevant source or condition changed. Do not exclude that root cause from hunting or assume the prior verdict still applies.
|
|
66
|
+
- Build current work units for every prior `needs_validation`, `deferred`, `blocked`, `out_of_scope`, and changed-source unit. These states are priority input, never deduplication or suppression keys.
|
|
67
|
+
- Carry a still-blocked prior `needs_validation` record with the same fingerprint only after current source supports its trace. Link it to a current `planned` unit with `prior_status: "prior_needs_validation"`; the record keeps the unresolved blocker. The Phase 3 verifier that re-checks the carried record becomes that unit's assignment owner; its re-check is the unit's first check and moves the unit to `candidate` with the carried fingerprint. Include the record in final verification.
|
|
68
|
+
- Treat prior rejected records as stale claims unless current evidence changes the failed trace or missing condition. An unchanged rejection suppresses only that exact claim, not review of the coverage unit.
|
|
69
|
+
- Record missing or incompatible ledgers instead of treating them as empty coverage.
|
|
70
|
+
|
|
71
|
+
State paths and source refs used in `run-metadata.json`. Summarize only the coverage consequences in `architecture.md`.
|
|
72
|
+
|
|
73
|
+
## Architecture summary and companion selection
|
|
74
|
+
|
|
75
|
+
The parent synthesizes `<output-dir>/architecture.md`, with a hard cap of about 1,000 words. Include:
|
|
76
|
+
|
|
77
|
+
1. Product, principals, normal authority, and protected resources.
|
|
78
|
+
2. The comparable-software baseline from Agent 1a, when one is source-grounded: what security trade-offs the comparable accepts. Use it to calibrate effort and severity, never to dismiss a demonstrated finding; if the comparable shares a defect pattern that has mattered in practice, that strengthens the finding. Omit this line when no meaningful comparable exists.
|
|
79
|
+
3. Tech stack, source-visible deployment paths, and offline build/test limits.
|
|
80
|
+
4. Entry surfaces and the important source-to-sink or lifecycle paths.
|
|
81
|
+
5. Trust boundaries and the strongest source-visible control on each.
|
|
82
|
+
6. Repository-relative starting paths.
|
|
83
|
+
7. Prior coverage gaps, changed-source and blocked revalidation targets, and same-source confirmed exclusions.
|
|
84
|
+
8. A short companion-selection summary derived from [ATTACK-CLASSES.md](ATTACK-CLASSES.md): selected files and the source-visible boundaries that require them.
|
|
85
|
+
|
|
86
|
+
Keep the assignment-level ordinary block, selected companion blocks, and excluded blocks with reasons in each ledger unit, not in `architecture.md`. This keeps the architecture cap valid for large runs and makes the exact hunter prompt map machine-checkable.
|
|
87
|
+
|
|
88
|
+
Do not select a companion file merely because the language or dependency name appears. Select it because reconnaissance found the trust-sensitive boundary described by its `When to use this file` section. Do not exclude a visible boundary just because another agent will review a related class.
|
|
89
|
+
|
|
90
|
+
## Deterministic coverage ledger
|
|
91
|
+
|
|
92
|
+
The parent writes `<output-dir>/coverage-ledger.json` as a top-level JSON array. Derive one unit for every material combination of entry surface, trust boundary, subsystem, and applicable ordinary or companion attack class at the granularity the run profile sets (`quick` uses one all-in-scope subsystem identity; `deep` adds lifecycle modes). For a scoped run, seed in-scope surfaces for assignment and retain discovered excluded surfaces as `out_of_scope` units so later full runs can turn them into current work.
|
|
93
|
+
|
|
94
|
+
Each dimension has a human label and a stable source-derived value in `canonical_refs`. Use the same canonical reference for the same source object across runs even if its display label changes. Suitable references include a repository-relative entry path plus exported scope, a route or message identity defined in source, the source control that defines a boundary, a repository package path, and the exact attack-class block reference. A block reference is `FILE.md#` plus the exact class name as written in bold or as a heading in that file — a stable identifier matched against the file text, not a rendered HTML anchor. For companion section blocks, use the heading text before any parenthetical qualifier (for example `Core discipline`). Do not derive references by lowercasing or slugging display labels.
|
|
95
|
+
|
|
96
|
+
Derive `coverage_id` without lossy slugs:
|
|
97
|
+
|
|
98
|
+
1. Require every reference to be Unicode NFC with valid scalar values, visible content, no control, format, line/paragraph separator, or default-ignorable code point, and no surrounding whitespace.
|
|
99
|
+
2. Encode its UTF-8 bytes with RFC 3986 percent encoding: leave only `A-Z a-z 0-9 - . _ ~` unescaped and use uppercase `%HH` for every other byte.
|
|
100
|
+
3. Join encoded `surface`, `boundary`, `subsystem`, and `attack_class` references with `::`; append encoded `lifecycle` when present.
|
|
101
|
+
|
|
102
|
+
Use the fixed canonical value `profile/quick/all-in-scope-subsystems` for the quick profile's coarsened subsystem dimension. Do not include wave number, agent, verdict, severity, or line number in a reference or ID. Sort units lexicographically by `coverage_id` before each assignment. Fail on every duplicate ID. If duplicate IDs have different semantic fields, treat that as a canonical identity collision; never merge or silently overwrite them. The validator also rejects one semantic tuple represented by different canonical references.
|
|
103
|
+
|
|
104
|
+
Each unit records:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"coverage_id": "...",
|
|
109
|
+
"canonical_refs": {
|
|
110
|
+
"surface": "src/router.ts#POST /users/:id",
|
|
111
|
+
"boundary": "src/authz.ts#requireOwner",
|
|
112
|
+
"subsystem": "packages/api",
|
|
113
|
+
"attack_class": "ATTACK-CLASSES.md#Access control"
|
|
114
|
+
},
|
|
115
|
+
"surface": "...",
|
|
116
|
+
"boundary": "...",
|
|
117
|
+
"subsystem": "...",
|
|
118
|
+
"attack_class": "...",
|
|
119
|
+
"starting_paths": ["repo/relative/path"],
|
|
120
|
+
"ordinary_attack_class_block": "ATTACK-CLASSES.md#Access control",
|
|
121
|
+
"selected_companion_blocks": ["FILE.md#section"],
|
|
122
|
+
"excluded_blocks": [{"block": "FILE.md#section", "reason": "..."}],
|
|
123
|
+
"prior_status": "new|prior_confirmed_same_source|prior_confirmed_changed_source|prior_needs_validation|prior_deferred|prior_blocked|prior_out_of_scope|prior_covered_same_source|prior_covered_changed_source|prior_rejected_claim_changed|none",
|
|
124
|
+
"attempts": [],
|
|
125
|
+
"wave": 1,
|
|
126
|
+
"status": "planned",
|
|
127
|
+
"agent_id": null,
|
|
128
|
+
"reviewed_paths": [],
|
|
129
|
+
"local_checks": [],
|
|
130
|
+
"result_fingerprints": [],
|
|
131
|
+
"unresolved": []
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
When `lifecycle` is material, add both `canonical_refs.lifecycle` and a human `lifecycle` field. `ordinary_attack_class_block` is null only when no ordinary block applies. The selected companion list includes each applicable class plus its companion `Core discipline`, `Universal moves`, and `Validation rules`; `excluded_blocks` records every considered but unselected block and the source fact that excludes it.
|
|
136
|
+
|
|
137
|
+
The parent may add bookkeeping fields but keeps the semantic fields above stable. In `prior_status`, `new` marks a surface first seen in this run when compatible prior ledgers exist; `none` marks a unit seeded when no compatible prior ledger is available. Prior `deferred`, `blocked`, `out_of_scope`, and changed-source units initialize as current `planned` work when now in scope. A prior same-source covered unit remains visible in the current ledger; assign changed source, important lifecycle paths, and exact conflicts first, then use the coverage critic to decide whether it needs another pass.
|
|
138
|
+
|
|
139
|
+
`attempts` is an append-only archive for evidence-bearing assignments that a coverage critic reopens. Before reassignment, append the prior unit's exact `wave`, `status`, `agent_id`, `reviewed_paths`, `local_checks`, `result_fingerprints`, and `unresolved`, plus the critic's source-backed `reassignment_reason`. Only `blocked`, `covered`, and `candidate` states can be archived. Archived attempts retain the same state and evidence invariants as live units, use strictly increasing waves below the current wave, and retain their producing owners and artifacts. The next assignment increments `wave`, uses a fresh owner, and starts with empty live evidence. If the profile or budget prevents another assignment, increment `wave` and use live `deferred` state with null owner, empty evidence, and the stop reason. Never copy an archived owner's checks or artifacts into the live state. A later live terminal state contains only the new attempt's evidence; the archive remains unchanged.
|
|
140
|
+
|
|
141
|
+
Enforce this state table exactly:
|
|
142
|
+
|
|
143
|
+
| Status | Unit `agent_id` | `reviewed_paths` / `local_checks` | `result_fingerprints` | `unresolved` |
|
|
144
|
+
|---|---|---|---|---|
|
|
145
|
+
| `planned` | null | empty | empty | empty |
|
|
146
|
+
| `not_applicable`, `out_of_scope`, `deferred` | null | empty | empty | nonempty reason |
|
|
147
|
+
| `in_progress` | canonical owner | empty | empty | empty |
|
|
148
|
+
| `blocked` | canonical owner | both nonempty owned partial evidence | empty | nonempty blocker |
|
|
149
|
+
| `covered` | canonical owner | both nonempty | empty | empty |
|
|
150
|
+
| `candidate` | canonical owner | both nonempty | nonempty | optional |
|
|
151
|
+
|
|
152
|
+
Canonical agent IDs match `^[a-z0-9][a-z0-9_-]{0,63}$` and are not Windows device names. Lowercase is mandatory, so one ledger cannot contain case-fold aliases. The unit `agent_id` records the assignment owner. Every check records its own `agent_id` and nonempty `reviewed_paths`; the unit-level `reviewed_paths` is exactly their union. A source-only check uses `artifact: null`. A local check requires a regular file promoted only by trusted parent-side code under exactly `agents/<check.agent_id>/artifacts/`. This lets hunter and verifier checks coexist in one unit. Scratch paths, output-root files, symlinks, special files, and another check owner's artifacts are not evidence.
|
|
153
|
+
|
|
154
|
+
The ledger is the coverage claim. An architecture summary, agent count, or generic "auth reviewed" sentence is not coverage evidence. Phase 2 closes units only from the paths and checks in a hunter's structured result.
|
|
155
|
+
|
|
156
|
+
Run `node <skill-dir>/validate-coverage-ledger.cjs <output-dir>/coverage-ledger.json` after seeding, after every parent update, and before Phase 6. The validator rejects input beyond 5 MiB, 64 nesting levels, 10,000 units, 1,000 entries in a nested collection, or 500,000 traversed values, and caps reported validation errors at 100. In practice the 5 MiB byte limit holds roughly 2,000-5,000 realistic units, so it binds before the 10,000-unit cap. Fix every error before assigning work or making a coverage claim.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Resource Exhaustion and Availability Hunting
|
|
2
|
+
|
|
3
|
+
#### When to use this file
|
|
4
|
+
|
|
5
|
+
Reach for this file when untrusted requests, messages, files, tenant state, or agent work can consume CPU, memory, disk, connections, worker slots, paid APIs, or queue capacity, or can deadlock/crash a shared service. This domain distinguishes a source-reviewable availability vulnerability from a general performance issue. Never validate by stressing a shared or live service.
|
|
6
|
+
|
|
7
|
+
Use `MEMORY-SAFETY-AND-BINARY.md` for memory-integrity defects and `PROTOCOLS-RPC-AND-MESSAGING.md` for broker delivery logic. A reachable fatal error belongs here for shared impact even when the underlying parser is covered elsewhere.
|
|
8
|
+
|
|
9
|
+
## Core discipline (include in every agent prompt for this domain)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
- Require an input-to-cost path, a missing effective bound, and impact on another user, shared service, safety function, or operator-owned spend. Self-limiting work in the requester's own process is not a service vulnerability.
|
|
13
|
+
- A missing rate limit is not enough. Check body/message/file caps, concurrency, queues, deadlines, database constraints, upstream gateways, and per-tenant quotas before calling a path unbounded.
|
|
14
|
+
- Do not run stress, saturation, or production tests. Use asymptotic analysis, small boundary fixtures, mocked paid calls, strict local resource limits, and deterministic cancellation tests.
|
|
15
|
+
- State attacker cost, service work, persistence, scope, and recovery. One bounded input with superlinear or persistent shared effect is materially different from sustained volume.
|
|
16
|
+
- Use `confirmed` for source-visible bounds failures demonstrated safely. Use `needs_validation` when upstream caps, deployed topology, autoscaling, paid quota, or recovery behavior is outside the repository.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Computational amplification attack classes (subagent_type: `general`)
|
|
20
|
+
|
|
21
|
+
**Superlinear parsing, matching, or evaluation**
|
|
22
|
+
Small accepted input drives catastrophic regex backtracking, nested parsing, recursive validation, symbolic evaluation, graph traversal, template expansion, or adversarial sort/hash behavior. Derive accepted depth/cardinality and complexity, then demonstrate a bounded growth curve locally.
|
|
23
|
+
|
|
24
|
+
**Decompression and representation amplification**
|
|
25
|
+
Compressed, sparse, nested, aliased, or encoded input expands far beyond the checked transfer or file size. Verify limits after every expansion and across parser stages, including archives, images, fonts, structured documents, and protocol compression tables.
|
|
26
|
+
|
|
27
|
+
**Database and downstream query amplification**
|
|
28
|
+
A small request creates broad scans, pathological joins, fan-out, unbounded sort/aggregation, or many downstream calls because query depth, filter cardinality, pagination, or expansion fields are not bounded. Confirm authorization does not intentionally permit the same resource scope.
|
|
29
|
+
|
|
30
|
+
## Resource accumulation attack classes (subagent_type: `general`)
|
|
31
|
+
|
|
32
|
+
**Unbounded buffering and cardinality**
|
|
33
|
+
Bodies, out-of-order streams, uploads, sessions, unique cache keys, metrics labels, log fields, subscriptions, or pending jobs accumulate without per-item and aggregate limits. Find cleanup and expiration on disconnect, timeout, cancellation, and partial parse.
|
|
34
|
+
|
|
35
|
+
**File descriptor, handle, and temporary-resource leaks**
|
|
36
|
+
Malformed or canceled work misses cleanup and retains sockets, files, database cursors, timers, subprocesses, temporary files, or object references. Confirm the leak repeats through bounded local iterations and affects a shared pool.
|
|
37
|
+
|
|
38
|
+
**Detached work after cancellation**
|
|
39
|
+
Client timeout, disconnect, canceled job, or failed authorization returns control but leaves database, model, network, or worker work running. Trace cancellation and deadline propagation through every layer.
|
|
40
|
+
|
|
41
|
+
## Quota and scheduling attack classes (subagent_type: `general`)
|
|
42
|
+
|
|
43
|
+
**Pre-authentication work imbalance**
|
|
44
|
+
Expensive parsing, key lookup, cryptography, decompression, or external requests happen before authentication and the earliest size/rate gate. Compare minimal requester effort to shared service cost and check upstream limits.
|
|
45
|
+
|
|
46
|
+
**Quota-accounting scope and reset gaps**
|
|
47
|
+
Accounting uses attacker-influenceable IP, route, tenant, key prefix, task ID, or other dimension, allowing one principal's work to escape its intended budget or consume another principal's allocation. Review integer overflow, distributed races, retries, reconnects, and account switching.
|
|
48
|
+
|
|
49
|
+
**Worker, pool, and priority starvation**
|
|
50
|
+
Low-priority or attacker-controlled jobs hold shared locks, workers, database pools, event-loop turns, or scheduler priority needed by unrelated users. Require a path that bypasses queue/concurrency fairness or retains a slot beyond its deadline.
|
|
51
|
+
|
|
52
|
+
## Failure and recovery attack classes (subagent_type: `general`)
|
|
53
|
+
|
|
54
|
+
**Reachable fatal error or deadlock**
|
|
55
|
+
An untrusted input reaches `panic`, abort, fatal assertion, unhandled exception, process exit, lock cycle, or infinite loop in a shared process. Confirm supervisor scope and whether one worker or the whole service becomes unavailable. A restarted isolated worker may reduce impact but does not erase the defect.
|
|
56
|
+
|
|
57
|
+
**Retry storm and fail-open amplification**
|
|
58
|
+
Timeouts, dependency errors, partially processed messages, or health-check failures trigger synchronized or unbounded retries without jitter, ceilings, circuit breaking, or deduplication. Verify one bounded failure source can create persistent aggregate work.
|
|
59
|
+
|
|
60
|
+
**Poison-record and head-of-line blocking**
|
|
61
|
+
One malformed record or message repeatedly fails at the front of a shared queue, partition, startup scan, migration, or recovery loop. Review skip/quarantine policy, offsets, and whether other tenants share the blocked unit.
|
|
62
|
+
|
|
63
|
+
**Unsafe recovery and capacity rollback**
|
|
64
|
+
A restart, restore, fallback, or cleanup path rebuilds unbounded state, ignores current quotas, or restores the input that immediately repeats failure. Recovery correctness is part of availability.
|
|
65
|
+
|
|
66
|
+
## Universal moves (apply across the above)
|
|
67
|
+
|
|
68
|
+
- Build an input-to-resource table: earliest accepted size/cardinality, work before auth, downstream fan-out, persistence, shared pool, limit and cleanup owner, recovery.
|
|
69
|
+
- Compare aggregate limits with per-object limits. Ten thousand valid one-byte items may evade a per-message cap while exhausting tenant-wide or process-wide state.
|
|
70
|
+
- Validate only in an isolated fixture with strict CPU/memory/time limits and small growth points. Mock external and paid calls and stop once the missing bound or cancellation is observable.
|
|
71
|
+
|
|
72
|
+
## Validation rules (apply before reporting ANY finding here)
|
|
73
|
+
|
|
74
|
+
1. Name untrusted input, requester work, service amplification or retained resource, shared blast radius, and recovery. Missing limits without concrete shared impact are hardening.
|
|
75
|
+
2. Confirm no source-visible upstream, parser, queue, tenant, or framework bound prevents the path. Unknown deployed controls require `needs_validation`.
|
|
76
|
+
3. For superlinear behavior, establish the accepted complexity and bounded local growth. For leaks, show repeatable retention after cleanup should occur. For fatal paths, identify process/supervisor isolation.
|
|
77
|
+
4. Prioritize by low requester work, unauthenticated reachability, cross-tenant scope, persistence, and poor recovery; do not validate with availability impact.
|
|
78
|
+
5. Return `confirmed` only with safe local proof and meaningful shared effect. Return `needs_validation` with the exact upstream limit, topology, quota, or recovery observation an owner must check.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cloudflare-security-audit
|
|
3
|
+
description: Cloudflare's six-phase repository security audit — reconnaissance, coverage-led hunting, candidate validation, structured findings, independent record verification, and a target-neutral report. Use when auditing or pen-testing a WHOLE repository or a third-party / untrusted codebase, or when the deliverable is an audit report artifact. For a routine ONE question — "is this secure", "can someone bypass this", "audit this endpoint", "who can call this" — or for a single-diff review lens on ONE's own deployed surfaces, read one.ie/ai/skills/security-audit/SKILL.md instead: this skill forbids probing deployed endpoints, which is ONE's primary evidence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Audit
|
|
7
|
+
|
|
8
|
+
Find vulnerabilities that violate a real trust boundary, then give owners the source evidence, safe reproduction, priority, and smallest effective fix. This is a defensive, source-first workflow. A candidate without a concrete affected principal, resource, or security outcome is not a confirmed finding.
|
|
9
|
+
|
|
10
|
+
## Operating modes
|
|
11
|
+
|
|
12
|
+
This skill is guidance by default. Loading it does not authorize the complete audit workflow or file creation.
|
|
13
|
+
|
|
14
|
+
- **Guidance mode**: For security questions, focused reviews, methodology, triage, or investigation of specific findings, use only the relevant parts of this skill. Do not automatically run all six phases, create an output directory, or write audit artifacts. You may launch focused agents when useful; they return results to the current task.
|
|
15
|
+
- **Full audit mode**: Use the complete workflow when the user explicitly asks to audit or pen-test a codebase, asks for a full, comprehensive, or end-to-end security review, or requests report artifacts. Run all six phases and write the files defined below.
|
|
16
|
+
|
|
17
|
+
If the request could mean either mode, ask one focused question before creating files or starting the complete workflow.
|
|
18
|
+
|
|
19
|
+
## Platform terminology
|
|
20
|
+
|
|
21
|
+
This skill is agent-neutral:
|
|
22
|
+
|
|
23
|
+
- **Parent** is the agent that coordinates the run and owns shared state.
|
|
24
|
+
- **Task tool** is the platform's delegation or sub-agent mechanism.
|
|
25
|
+
- **`research` agent** is a delegated agent for focused source exploration and factual verification.
|
|
26
|
+
- **`general` agent** is a delegated agent for broad investigation and bounded local execution.
|
|
27
|
+
- **`subagent_type:`** in a heading names which of these two delegated agent roles runs that work.
|
|
28
|
+
|
|
29
|
+
Use equivalent platform capabilities while preserving role, write-isolation, prompt, and independence boundaries.
|
|
30
|
+
|
|
31
|
+
## Universal execution safety
|
|
32
|
+
|
|
33
|
+
These rules apply in both operating modes. Source inspection is read-only. Run target-controlled builds, tests, processes, browsers, emulators, fuzzers, and fixture processing only inside an OS-enforced sandbox that provides all of these controls:
|
|
34
|
+
|
|
35
|
+
- no external network; use only an isolated loopback namespace when the check needs local client/server traffic;
|
|
36
|
+
- an empty environment populated from an explicit allowlist with safe values, with scratch-local `HOME`, temporary directories, and caches;
|
|
37
|
+
- a read-only target and toolchain, with the target-controlled process able to write only inside its assigned `scratch/` directory; and
|
|
38
|
+
- explicit low CPU, memory, process, file-size, disk, and wall-clock limits.
|
|
39
|
+
|
|
40
|
+
The agent, outside the target-controlled process, may make a disposable source copy in an assigned `scratch/` directory when a build must write beside source. In guidance mode, do not retain target-controlled files. In full audit mode, only trusted parent-side code may promote the minimum non-secret result to retained `artifacts/` using the procedure under Write isolation. Never expose a retained output directory (other than the agent's own assigned `scratch/`), another agent's directory, the host home directory, credentials, sockets, or shared services to target code. Do not install dependencies or let builds fetch them. Use only tools and dependencies already available locally. If every control cannot be enforced, do not execute target code: report the missing sandbox capability as a needs-validation blocker and give a safe validation plan.
|
|
41
|
+
|
|
42
|
+
Use dummy principals, fixtures, and secrets. Do not probe deployed endpoints, external services, shared infrastructure, production identities, other users' data, or live control planes. Do not test availability against a live or shared process, publish artifacts, alter releases, spend paid API quota, or continue beyond the minimum local effect needed to establish a defect. If the decisive fact is outside source or the sandboxed fixture, report it as needing validation.
|
|
43
|
+
|
|
44
|
+
## Full audit setup
|
|
45
|
+
|
|
46
|
+
In full audit mode, resolve these values before reconnaissance:
|
|
47
|
+
|
|
48
|
+
- **Skill directory**: the absolute directory containing this `SKILL.md`.
|
|
49
|
+
- **Target**: the absolute repository root under review.
|
|
50
|
+
- **Repo name**: a stable repository identifier from the directory or local Git remote.
|
|
51
|
+
- **Output directory**: a new writable directory outside the target, defaulting to `~/security-audit-skill/<repo-name>/run-<N>`, where `<N>` is the next unused integer. Use a directory inside the target only when the user explicitly selects it and the parent verifies that version control ignores the whole directory. Otherwise stop and request an external path.
|
|
52
|
+
- **Source ref**: the reviewed commit and whether the worktree is dirty. Do not treat unreviewed generated or modified files as another revision.
|
|
53
|
+
|
|
54
|
+
### Write isolation
|
|
55
|
+
|
|
56
|
+
The parent creates and is the only writer of shared run files:
|
|
57
|
+
|
|
58
|
+
- `run-metadata.json`
|
|
59
|
+
- `architecture.md`
|
|
60
|
+
- `coverage-ledger.json`
|
|
61
|
+
- `findings.json`
|
|
62
|
+
- `REPORT.md`
|
|
63
|
+
- `FINDINGS-DETAIL.md`
|
|
64
|
+
- `NEEDS-VALIDATION.md`
|
|
65
|
+
|
|
66
|
+
Each hunter or verifier receives a unique root under `<output-dir>/agents/<agent-id>/`, with separate `scratch/` and `artifacts/` directories. Canonical agent IDs match `^[a-z0-9][a-z0-9_-]{0,63}$` and must not equal a Windows device name such as `con`, `prn`, `aux`, `nul`, `com1` through `com9`, or `lpt1` through `lpt9`. Lowercase IDs prevent case-fold collisions. The agent and every target-controlled process may write only to `scratch/`; retained `artifacts/` is parent-owned, is never exposed to the sandbox, and is writable only by trusted parent-side promotion code. Agents may not change shared files, target source, retained artifacts, or another agent's directory. Do not use `/tmp` or the host home directory as a writable fallback.
|
|
67
|
+
|
|
68
|
+
Before execution, the parent opens and retains trusted, non-inheritable directory descriptors for the agent's `scratch/` and `artifacts/` roots, and records an allowlist of expected scratch-relative artifact files plus explicit per-file and cumulative byte limits. Never pass those descriptors to the agent or sandbox. After the sandbox and all its processes terminate, trusted parent-side code promotes each allowlisted file separately:
|
|
69
|
+
|
|
70
|
+
1. Validate the declared relative path: reject absolute, empty, `.`, `..`, or symlinked components.
|
|
71
|
+
2. Walk each parent component from the retained scratch-root descriptor with no-follow directory-relative operations; never reopen by path.
|
|
72
|
+
3. Open the leaf no-follow and nonblocking.
|
|
73
|
+
4. Verify with `fstat` that it is a regular file with link count exactly one and within the recorded per-file and cumulative byte limits.
|
|
74
|
+
5. Enforce those limits again while reading from that descriptor.
|
|
75
|
+
6. Copy exactly the verified size, repeat `fstat`, and reject a changed identity, type, link count, or size.
|
|
76
|
+
7. For the destination, walk every parent component from the retained artifacts-root descriptor with no-follow directory-relative operations; require each existing component to be a real directory, and create any missing directory exclusively before reopening and verifying it no-follow.
|
|
77
|
+
8. Create the leaf exclusively without following links, verify that the opened destination is a regular file with link count exactly one, and copy from the verified source descriptor without reopening either path.
|
|
78
|
+
9. Use equivalent race-safe APIs on non-POSIX systems.
|
|
79
|
+
10. Never recursively copy or glob scratch, extract an archive into artifacts, or open or promote a symlink, FIFO, socket, device, directory, hard-linked file, changing file, or file that exceeds its bound.
|
|
80
|
+
11. If any check is unavailable, cannot be enforced, or fails, discard the scratch entry; if it is decisive evidence, retain `needs_validation` with the exact promotion blocker.
|
|
81
|
+
|
|
82
|
+
[HUNTING.md](HUNTING.md) and [VALIDATION-AND-REPORTING.md](VALIDATION-AND-REPORTING.md) carry this procedure as one identical fenced block for hunter and verifier prompts; it states the same rules in the same order as this list.
|
|
83
|
+
|
|
84
|
+
For a reproduced check, record the command, exact test input, sandbox limits, and only the allowlisted environment variable names plus safe non-secret values needed to reproduce it. Never capture or copy the ambient environment, inherited variables, credential values, authentication state, or unrelated host paths. Launch from an empty environment rather than trying to redact one after execution.
|
|
85
|
+
|
|
86
|
+
Before delegation, the parent writes `run-metadata.json` with at least `run_id`, `repo`, `target`, `source_ref`, `profile`, `scope_paths`, `budget` (null if unset), `execution_policy: "sandboxed-source-and-local-only"`, selected companion files, prior-run paths, shared-file owners, and `run_status: "in_progress"`. Update metadata only when those facts change; candidate state belongs in the coverage ledger and `findings.json`.
|
|
87
|
+
|
|
88
|
+
## Full audit planning
|
|
89
|
+
|
|
90
|
+
The coverage, prior-run, profile, and budget requirements in this section apply only in full audit mode.
|
|
91
|
+
|
|
92
|
+
### Coverage and prior runs
|
|
93
|
+
|
|
94
|
+
No one pass is complete. Build a deterministic coverage plan before hunting and update it after every agent result. [RECONNAISSANCE.md](RECONNAISSANCE.md) defines the stable coverage units and [HUNTING.md](HUNTING.md) defines coverage-critic waves. The parent alone updates the ledger.
|
|
95
|
+
|
|
96
|
+
If prior runs exist, read every compatible `coverage-ledger.json` and `findings.json` before planning the current run:
|
|
97
|
+
|
|
98
|
+
1. Compare the relevant current source with each prior record and unit. A prior source ref alone is not evidence that a path is unchanged.
|
|
99
|
+
2. Carry a prior `confirmed` record into the current candidate set only when its relevant source and conditions are unchanged and its evidence still meets the current contract. Link it to a current ledger unit seeded `planned`, preserve its fingerprint, exclude only that carried root cause from hunters, and send the carried record through the current final verification path; the Phase 3 verifier that re-checks it becomes that unit's assignment owner and moves it to `candidate`.
|
|
100
|
+
3. When relevant source for a prior `confirmed` record changed, create a current planned revalidation unit. Do not put that record on the hunter exclusion list. It remains confirmed only if current independent validation establishes the current path and result.
|
|
101
|
+
4. Make prior `needs_validation`, `deferred`, `blocked`, `out_of_scope`, and any changed-source unit current work. A still-external `needs_validation` record may be carried only after the current source trace is checked and linked by fingerprint to a current `planned` unit whose verifier re-check supplies its owner and evidence; the record keeps the unresolved blocker. These prior states never suppress a current unit.
|
|
102
|
+
5. A prior same-source covered unit may inform priority, but it remains visible in the current ledger. A prior `rejected` record suppresses only the unchanged failed claim, not coverage of its unit; changed evidence creates current work.
|
|
103
|
+
6. Read the prior profile and scope. A prior `quick` or scoped ledger contributes only its recorded evidence and gaps, never an implied "rest is fine."
|
|
104
|
+
|
|
105
|
+
If no prior ledger exists, say so in the final coverage statement. Never imply that one run exhausts the target.
|
|
106
|
+
|
|
107
|
+
### Run profiles and scope
|
|
108
|
+
|
|
109
|
+
During full audit setup, pick a profile from the user's request or propose one from the target's size and stakes. Record it in `run-metadata.json` (`profile`, `scope_paths`) and state it in the report. The default is `standard`.
|
|
110
|
+
|
|
111
|
+
- **`quick`** — a bounded pass for small targets, re-runs, or a fast first look. Coarsen ledger units to surface × boundary × attack class (subsystem uses the fixed canonical `profile/quick/all-in-scope-subsystems` identifier), run exactly one hunter wave followed by exactly one final coverage-critic pass, and use one fresh verifier per candidate for both candidate validation and final record verification. Do not launch a follow-up hunter wave: record the critic's accepted discoveries and reassignments as `deferred`.
|
|
112
|
+
- **`standard`** — the workflow as written.
|
|
113
|
+
- **`deep`** — for high-stakes or large targets. Split ledger units per subsystem and lifecycle mode, run critic waves to a clean pass, keep candidate validation and final record verification as separate fresh agents, and give `prior_covered_same_source` units an independent second pass.
|
|
114
|
+
|
|
115
|
+
A **scoped run** audits a subset: named paths, one subsystem, one companion domain, or the diff between two source refs. Seed ledger units only for in-scope surfaces and record everything else as `out_of_scope` — never as `covered`. A scoped or `quick` run must present itself as partial coverage.
|
|
116
|
+
|
|
117
|
+
Profiles change breadth and redundancy, never the evidence bar. Do not scale away the candidate gate, the source/local execution boundary, `needs_validation` discipline, schema validation, or independent verification of `confirmed` records.
|
|
118
|
+
|
|
119
|
+
#### Cost budget
|
|
120
|
+
|
|
121
|
+
The ledger makes spend countable: one unit is roughly one hunter assignment, and one surviving candidate is one or two verifier assignments depending on profile. When the user sets a budget — or the parent proposes one for a large target — record `budget` in `run-metadata.json` as a maximum number of agent invocations across all phases.
|
|
122
|
+
|
|
123
|
+
Apply the strict budget gate before launching any reconnaissance agent. Reserve the four baseline reconnaissance calls, one final post-wave critic for `quick` or one post-wave plus one distinct final-clean critic for `standard`/`deep`, and at least one verifier call. Add focused reconnaissance only after repeating this gate for each extra call. If the requested budget cannot fund that minimum, launch no agent: ask for a larger budget, narrower scope, or different profile. If the request remains unchanged, set `run_status: "incomplete"` with `incomplete_reason: "budget_cannot_fund_reconnaissance_and_reserves"` and report that no audit pass ran.
|
|
124
|
+
|
|
125
|
+
Spend it in this order:
|
|
126
|
+
|
|
127
|
+
1. Count reconnaissance, every post-wave critic, and the separate final-clean critic as agent invocations.
|
|
128
|
+
2. **Reserve critics and validation before hunting.** For `quick`, reserve its one post-wave final critic. Before every `standard` or `deep` hunter wave, reserve one immediate post-wave critic plus one distinct final-clean critic. Also reserve verifier cost from the profile (about 1 or 2 agents per expected candidate; when in doubt reserve 30% of the balance after critic reservation). Never assign hunters into either reserve.
|
|
129
|
+
3. Assign hunters to units in priority order until the hunting allowance is spent. Spend the reserved post-wave critic immediately after that wave; keep the final-clean and validation reserves intact.
|
|
130
|
+
4. Before a later wave, reserve its new post-wave critic again. If the remaining budget cannot cover the required critic calls and validation reserve, launch no hunters from that wave, mark its planned units `deferred` with reason `budget_cannot_reserve_critics_and_validation`, and use the retained final-clean critic to record the resulting gap.
|
|
131
|
+
|
|
132
|
+
Before wave 1, update the pre-recon estimate with seeded units, implied hunter count, mandatory critic calls, validation reserve, and whether the remaining budget covers the plan. If it clearly cannot, say so and propose either a tighter scope or a coarser profile instead of silently thinning evidence. If later facts consume the required final-critic reserve, launch no hunters, mark all planned work deferred, set the run incomplete with reason `critic_budget_exhausted`, and make no complete-coverage claim.
|
|
133
|
+
|
|
134
|
+
A strict total-agent budget can still be exceeded by an unexpectedly large candidate set or by a material Phase 5 replacement that needs another independent verifier. If the remaining budget cannot validate every candidate, stop hunting, validate candidates in fingerprint order while the budget permits, and set `run_status: "incomplete"` plus `incomplete_reason: "validation_budget_exhausted"`. Keep each unvalidated fingerprint linked to a `candidate` ledger unit with that unresolved reason. Do not put an unvalidated candidate in `findings.json`, relabel it `needs_validation`, or report the run as complete. Phase 6 may produce a partial report only if its first section states that candidate validation is incomplete and lists the affected fingerprints and units. Never exceed a user-set strict budget silently.
|
|
135
|
+
|
|
136
|
+
## Core principles
|
|
137
|
+
|
|
138
|
+
### Require a boundary and result
|
|
139
|
+
|
|
140
|
+
For every candidate, name the lower-trust principal, accepted input or action, intended control, crossed boundary, affected principal or resource, and concrete observed or owner-observable result. Do not elevate a missing best practice, guessed deployment behavior, generic parser crash, or self-impact into a security finding.
|
|
141
|
+
|
|
142
|
+
### Use bounded local evidence
|
|
143
|
+
|
|
144
|
+
Static analysis establishes the source path. Sandboxed local tests resolve behavior when all execution controls are available: a minimal function harness, existing unit test, small parser fixture, dummy-tenant integration test, locally rendered configuration, or bounded isolated-loopback client. Stop at a wrong return value, unauthorized dummy record, sanitizer finding, policy difference, or other minimum effect. Do not extend the local check beyond the minimum boundary result or produce persistence, post-fault, or concealment material.
|
|
145
|
+
|
|
146
|
+
### Respect source visibility
|
|
147
|
+
|
|
148
|
+
Deployment controls, proxy behavior, provider settings, browser headers, identity policy, broker ACLs, packaging, and topology are real controls. If they are required and absent from the repository, do not assume either presence or absence. Use `needs_validation` with the exact missing fact and a safe owner-observed or local plan.
|
|
149
|
+
|
|
150
|
+
### Separate priority from certainty
|
|
151
|
+
|
|
152
|
+
Only `confirmed` records receive severity. Likelihood and impact must reflect the demonstrated conditions and result; overall severity cannot exceed demonstrated impact. `needs_validation` means a specific source-grounded boundary hypothesis is blocked, not a low-confidence confirmed vulnerability, and it has no severity.
|
|
153
|
+
|
|
154
|
+
Calibrate overall severity with these anchors:
|
|
155
|
+
|
|
156
|
+
- **critical** — an unauthenticated actor gains code execution, full data-store access, or takeover of arbitrary accounts.
|
|
157
|
+
- **high** — an actor fully defeats an explicit security control with real consequences: authentication bypass, cross-tenant read or write, stored script execution affecting other users, authenticated code execution, or an unauthenticated remote stop of a shared service.
|
|
158
|
+
- **medium** — a real boundary violation with limited blast radius, uncommon preconditions, or consequences confined to a narrow resource set.
|
|
159
|
+
- **low** — disclosure of non-secret internals, or an effect requiring sustained effort for minimal gain.
|
|
160
|
+
- **informational** — a confirmed but minimal-impact observation, useful mainly as a prerequisite inside a larger finding.
|
|
161
|
+
|
|
162
|
+
The high/medium discriminator: does the demonstrated result fully defeat an explicit control for an action with real consequences, or only weaken it? If you cannot state the concrete damage, the severity is lower than it feels.
|
|
163
|
+
|
|
164
|
+
### Recommend the smallest effective source fix
|
|
165
|
+
|
|
166
|
+
For each confirmed finding, identify the invariant the code must enforce and the narrowest source change that enforces it at the last trusted decision point. Prefer specific repository-relative changes and regression tests over generic hardening advice. The audit describes fixes; it does not modify target source.
|
|
167
|
+
|
|
168
|
+
## Full audit workflow
|
|
169
|
+
|
|
170
|
+
In full audit mode, follow all six phases in order:
|
|
171
|
+
|
|
172
|
+
1. **Reconnaissance** — map the source, trust boundaries, local build paths, companion selections, prior evidence, and initial deterministic coverage ledger with [RECONNAISSANCE.md](RECONNAISSANCE.md).
|
|
173
|
+
2. **Coverage-led hunting waves** — assign isolated hunters from the ledger and collect structured candidate results with [HUNTING.md](HUNTING.md), [ATTACK-CLASSES.md](ATTACK-CLASSES.md), and the selected domain companions.
|
|
174
|
+
3. **Candidate validation** — consolidate fingerprints and give every candidate to a fresh source verifier as defined in [VALIDATION-AND-REPORTING.md](VALIDATION-AND-REPORTING.md).
|
|
175
|
+
4. **Structured output** — write all final `confirmed`, `needs_validation`, and `rejected` records to `findings.json`; validate it with `report-schema.json` and `validate-findings.cjs`, and validate the coverage claim with `validate-coverage-ledger.cjs`.
|
|
176
|
+
5. **Independent record verification** — use fresh agents to verify final source claims and reconcile corrections or state changes.
|
|
177
|
+
6. **Target-neutral report** — derive `REPORT.md`, `FINDINGS-DETAIL.md`, and `NEEDS-VALIDATION.md` from the final records, with no live-probe instructions.
|
|
178
|
+
|
|
179
|
+
Do not end the run before one of exactly two terminal states: (a) all Phase 6 artifacts are written and both validators pass, or (b) `run_status: "incomplete"` is recorded with its exact reason and the gap is disclosed in the report. Never stop mid-phase.
|
|
180
|
+
|
|
181
|
+
## Anti-patterns
|
|
182
|
+
|
|
183
|
+
1. Checklist deviations presented as vulnerabilities.
|
|
184
|
+
2. Defense-in-depth advice with no reachable boundary violation.
|
|
185
|
+
3. Live or shared-environment testing where bounded local evidence is insufficient.
|
|
186
|
+
4. Guessing provider, proxy, browser, identity, or deployment behavior not present in source.
|
|
187
|
+
5. Treating intended same-principal authority or self-impact as a cross-boundary result.
|
|
188
|
+
6. Reporting a parser or runtime effect stronger than the observed effect.
|
|
189
|
+
7. Emitting prose-only hunter results that cannot be deduplicated or verified.
|
|
190
|
+
8. Re-reporting carried same-source prior confirmed records or using them as exemplars that anchor the hunt.
|
|
191
|
+
9. Assigning severity to `needs_validation` records.
|
|
192
|
+
10. Writing the report before independent verification or letting prose and JSON disagree.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Supply Chain and Release Hunting
|
|
2
|
+
|
|
3
|
+
#### When to use this file
|
|
4
|
+
|
|
5
|
+
Reach for this file when the target resolves dependencies, builds from untrusted contributions, runs CI, creates release artifacts, signs or promotes builds, loads plugins, or updates deployed software. This domain covers trust handoffs from source and dependency to the artifact a user runs. Use `MEMORY-SAFETY-AND-BINARY.md` for flaws inside a local binary loader and `CLOUD-AND-DEPLOYMENT.md` for runtime workload authority.
|
|
6
|
+
|
|
7
|
+
Split large targets into dependency resolution, CI isolation, artifact provenance, release authorization, and updater/plugin trust.
|
|
8
|
+
|
|
9
|
+
## Core discipline (include in every agent prompt for this domain)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
- A mutable or known-vulnerable dependency is not a finding by itself. Show who can influence resolution, which build consumes it, and what execution or release boundary follows.
|
|
13
|
+
- Follow integrity across every handoff: source identity, resolved inputs, build worker, artifact identity, test result, signature/attestation, promotion, and update consumer.
|
|
14
|
+
- CI configuration is authorization code. Establish which event triggered a workflow, whose code runs, which secrets and tokens exist, and what it may publish or mutate.
|
|
15
|
+
- A checksum fetched from the same untrusted location as the artifact does not establish independent integrity. Identify the trusted root and failure behavior.
|
|
16
|
+
- Use `confirmed` for in-repo control-flow failures with bounded local validation. Use `needs_validation` for branch protection, hosted-runner, registry, signing-service, or production promotion facts that are not observable.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Dependency and build-input attack classes (subagent_type: `general`)
|
|
20
|
+
|
|
21
|
+
**Dependency source and namespace confusion**
|
|
22
|
+
Resolver configuration can select an unintended public/private namespace, fallback registry, mirror, repository, or source URL. Review package names, source priority, lockfile and checksum use, alternate build files, platform-specific resolution, and first-install versus update behavior.
|
|
23
|
+
|
|
24
|
+
**Mutable and unbound build inputs**
|
|
25
|
+
Builds consume branches, tags, unverified submodules, downloaded tools, generated assets, remote includes, floating CI actions, or container tags whose content can change without source review. Require a lower-trust writer and a path into trusted build output; reproducibility by itself does not prove authenticity.
|
|
26
|
+
|
|
27
|
+
**Generated-source and codegen provenance gaps**
|
|
28
|
+
Schemas, vendored archives, generated clients, localization, documentation examples, or binary blobs produce executable or shipped content without the same review and integrity gate as source. Compare local regeneration with committed output and verify who controls input and generator.
|
|
29
|
+
|
|
30
|
+
**Build-context inclusion**
|
|
31
|
+
Secrets, local configuration, repository metadata, test fixtures, or developer artifacts enter a package or image because the build context and ignore rules exceed intended release inputs. Confirm that the resulting artifact exposes a real credential, private data, or privileged configuration.
|
|
32
|
+
|
|
33
|
+
## CI and automation attack classes (subagent_type: `general`)
|
|
34
|
+
|
|
35
|
+
**Untrusted code in a privileged workflow**
|
|
36
|
+
A pull request, issue comment, fork, dependency update, or external event runs contributor-controlled code with protected secrets, write tokens, deployment authority, or a trusted runner. Compare trigger type, checkout ref, approval gate, environment protection, and permission narrowing. Do not assume repository-host defaults that are not in source.
|
|
37
|
+
|
|
38
|
+
**Workflow command and expression confusion**
|
|
39
|
+
Attacker-controlled branch names, commit messages, issue fields, artifact names, matrix values, or generated output enter shell commands, template expressions, paths, or privileged workflow inputs without canonical validation.
|
|
40
|
+
|
|
41
|
+
**Cache, artifact, and workspace trust mixing**
|
|
42
|
+
A lower-trust job can populate a cache, artifact, shared workspace, or output that a higher-trust job later restores and executes or releases. Review cache keys and namespaces, artifact producer identity, digest binding, retention, and whether promotion re-resolves by mutable name.
|
|
43
|
+
|
|
44
|
+
**Automation identity overreach**
|
|
45
|
+
CI jobs receive permissions beyond the operation, repository, environment, or duration needed, and untrusted job inputs can select the affected resource. Missing least privilege alone is hardening; require a reachable privileged action.
|
|
46
|
+
|
|
47
|
+
## Release and update attack classes (subagent_type: `general`)
|
|
48
|
+
|
|
49
|
+
**Build-to-promotion substitution**
|
|
50
|
+
Tests, review, signature, and publication refer to mutable tags, filenames, channels, or artifact IDs rather than the same immutable digest. Check every copy, repack, architecture merge, and provenance step between build and release.
|
|
51
|
+
|
|
52
|
+
**Release authorization and signing-policy gaps**
|
|
53
|
+
A release or signature is accepted from the wrong workflow, repository, branch, environment, key role, or threshold. Review identity claims inside attestations and verify the consumer validates them, not just a valid signature. Rotation, expiry, and revocation must fail closed where policy requires.
|
|
54
|
+
|
|
55
|
+
**Update metadata and rollback confusion**
|
|
56
|
+
An updater authenticates payload bytes but not version, product, platform, channel, target path, expiry, or rollback state, or it accepts metadata and payload from different authorized transactions. Verify atomic installation and recovery behavior. A signature API call without policy binding is incomplete.
|
|
57
|
+
|
|
58
|
+
**Plugin and extension trust expansion**
|
|
59
|
+
An extension package gains host authority beyond its declared scope, a lower-trust publisher can replace another publisher's identity, or install/update hooks run before authenticity and capability checks. Intended installation of arbitrary same-user plugins is not a privilege boundary.
|
|
60
|
+
|
|
61
|
+
## Universal moves (apply across the above)
|
|
62
|
+
|
|
63
|
+
- Walk backward from a released digest or installed update to every source, generated input, credential, worker, cache, test result, and authorization decision.
|
|
64
|
+
- Compare untrusted and protected workflow events side by side. Mark each persisted channel crossing between them and require an immutable identity plus producer trust.
|
|
65
|
+
- Review revoked key, failed download, missing attestation, partial platform release, rollback, and registry outage paths. The failure policy is part of release integrity.
|
|
66
|
+
|
|
67
|
+
## Validation rules (apply before reporting ANY finding here)
|
|
68
|
+
|
|
69
|
+
1. Name the lower-trust actor, controllable source/cache/artifact/metadata, consuming trusted job or updater, and resulting unauthorized publication, code inclusion, secret disclosure, or privileged execution.
|
|
70
|
+
2. Prove artifact identity across the broken handoff. A different mutable name or unbound digest must reach a real consumer.
|
|
71
|
+
3. Verify built-in package-manager, repository-host, registry, and signing defaults for the pinned version. Unknown hosted controls require `needs_validation`.
|
|
72
|
+
4. Keep local validation bounded: use a harmless fixture repository, dummy credential marker, local registry/config, and non-production artifact namespace. Do not publish or alter a real release.
|
|
73
|
+
5. Return `confirmed` only with a complete source-visible handoff and meaningful result. Return `needs_validation` with the precise branch, runner, registry, signing, or deployment fact an owner must observe.
|