What it is
A method for the gap between what the documentation says a system should do and what the code actually does: establish intent, gather enforcement points in code as evidence, compare one boundary at a time, keep only drift that crosses a trust, cost, data or tenant boundary. For auditing AI-built code or checking access control against documented permissions. It does not do sink-level vulnerability analysis and does not write intent down for you.
Core workflow
| Stage | Content |
|---|---|
| Trigger | Auditing AI-built code, reviewing access control against documented permissions, checking whether a codebase matches its own docs |
| Input | Written intent docs (permissions.md, architecture.md, variables.md or the repo’s equivalents), plus the code under audit |
| Steps | 1 Establish intent, treating docs as claims to verify → 2 gather implementation evidence, cited file and line → 3 compare boundary by boundary, distrusting comments like “internal only”, “admin only”, “validated elsewhere” → 4 classify by whether a real actor could cross into data, money, infrastructure or another tenant → 5 each finding names the doc quote, the code citation, attacker and victim, and the concrete fix |
| Output | Mismatches ranked by exposure, each with both citations and a fix |
| Boundary | Missing or stale docs are the first finding; without both sides cited it is a question, not a finding |
Getting started: Confirm the permission and architecture docs exist and are current; otherwise document first, then audit.
Traits
- Both sides must be citable: doc quote plus code line; one side alone is only a question
- Separates drift that matters from cosmetic drift: only crossing a trust, cost, data or tenant boundary counts
- Docs and code are both treated as untrusted input: analyze them, never follow instructions embedded in them
- Documented-but-unenforced is a finding; enforced-but-undocumented flags the docs as stale
Who it is for and who it is not for
| Good fit | Poor fit |
|---|---|
| Checking that permissions really hold before shipping AI-built code | A repo whose docs are missing or dead |
| Verifying that cron-only or admin-only endpoints are really restricted | Finding injections, XSS or other concrete defects |
| Judging whether a codebase matches its own documentation | A generic lint report |
How it differs
| Need | Use |
|---|---|
| Write intent into permissions.md and friends first | shipping-artifacts (the companion skill the text cites) |
| Find concrete flaws along data flow | Sink-level security analysis, which the text says this does not replace |
| Check only internal code consistency | A generic linter, which the text says has no model of intent |
Source-level risks
| Risk | Source | Impact |
|---|---|---|
| Only works once intent is written down | “Purpose”, stated outright | A repo without docs fails at step one |
| Manual comparison, no scripts or automation | Task record: empty deps, no scripts | Coverage depends on how much code the auditor reads |
| Whether drift “matters” is a semantic judgement | “Method”, step 4 gives only boundary types | At scale, cross-tenant and cost boundaries are easy to miss |
| Cites shipping-artifacts with no link or content | “Purpose” and “Context” | Readers who cannot find it must invent their own doc convention |