1---2name: audit-integrity-23description: Enforce AppSec audit integrity for security analysis, code review, threat modeling, SAST, SCA, and quality scan agents. Use this skill when running a post-analysis quality gate, preventing rationalization, retrying failed evidence collection, running a second-pass self-critique, scoring output from 1-10 with a ≥8 threshold, or recording governed lessons or memories.4---56# Audit integrity78Apply an evidence-first quality framework to AppSec analysis so every finding, omission, retry, self-critique, and lesson is explicit, cited, and intellectually honest before delivery.910## When to invoke1112- "Run the audit integrity gate on this security review."13- "Self-critique this SAST or SCA analysis before delivery."14- "Check that the threat model did not rationalize missing evidence."15- "Apply the AppSec quality gate with ≥8 scoring."16- "Record lessons from this false positive or methodology gap."1718## Integrity components1920| Component | Reference file | Purpose | When to apply |21| --- | --- | --- | --- |22| Clarification Protocol | `references/clarification-protocol.md` | Ask ≤2 targeted questions before analysis when scope is ambiguous. | Before analysis if scope is unclear. |23| Anti-Rationalization Guard | `references/anti-rationalization-guard.md` | Detect prohibited rationalizations and replace them with mandatory evidence-seeking responses. | During every decision point. |24| Self-Critique Loop | `references/self-critique-loop.md` | Run a mandatory second-pass review after the initial analysis. | After initial findings are drafted. |25| Retry Protocol | `references/retry-protocol.md` | Retry failed evidence collection once, then document residual gaps. | On tool failure, inaccessible files, or incomplete data. |26| Non-Negotiable Behaviors | `references/non-negotiable-behaviors.md` | Non-negotiable and non-negotiable behaviors: never fabricate, always cite evidence, report gaps, and preserve uncertainty. | Throughout the audit. |27| Self-Reflection Quality Gate | `references/self-reflection-quality-gate.md` | Score categories from 1-10 and require a ≥8 threshold per category. | Before delivery. |28| Self-Learning System | `references/self-learning-system.md` | Govern Lesson and Memory creation for novel domain-specific findings, false positives, or methodology gaps. | After delivery or when durable learning is warranted. |2930## Procedure31321. Before analysis, apply the Clarification Protocol if scope, target, or evidence source is ambiguous; ask no more than two targeted questions when interaction is possible.332. During analysis, apply the Anti-Rationalization Guard and Non-Negotiable Behaviors to every claim and evidence gap.343. After the first pass, execute the Self-Critique Loop as a second pass; customize the checklist for the agent's domain.354. On any failed tool, missing file, or unavailable evidence, apply the Retry Protocol: retry once, then document the remaining gap.365. Before delivery, run the Self-Reflection Quality Gate. All categories must score ≥8 or the agent must revise and rescore.376. After delivery, create governed Lessons/Memories and lesson/memory records only for novel findings, false positives, or methodology gaps that meet the Self-Learning System rules.3839## Agent-specific adaptation4041| Agent type | Add to Self-Critique Loop | Add to Self-Reflection Quality Gate |42| --- | --- | --- |43| SAST/SCA agents | Taint trace completeness, dependency manifest coverage, reachable sink validation. | Evidence depth, exploitability calibration, manifest coverage. |44| SonarQube-style agents | Rating sanity check and A-E consistency with findings. | Rating consistency, remediation specificity, false-positive control. |45| Threat modeling agents | STRIDE category completeness per trust boundary and data flow. | Boundary coverage, abuse-case realism, mitigation traceability. |46| Code review agents | Trust boundary audit, data flow tracing, changed-line versus reachable-code distinction. | Changed-code relevance, regression risk, citation quality. |4748## Criteria4950### Evidence honesty5152- [ ] Every finding has concrete evidence: file/line, data flow, dependency record, policy, or tool output.53- [ ] Gaps are reported as gaps, not converted into assumptions.54- [ ] Tool failures follow the retry-once protocol before being documented.5556### Output quality5758- [ ] Findings are severity-calibrated and do not exaggerate unsupported impact.59- [ ] Self-critique changed the result or explicitly confirmed no changes with reasons.60- [ ] Every self-reflection category scores ≥8 before delivery.6162## Progressive disclosure and bundled resources6364- `references/clarification-protocol.md`: ambiguity handling and ≤2-question rule.65- `references/anti-rationalization-guard.md`: anti-rationalization prohibited rationalization table and mandatory responses.66- `references/self-critique-loop.md`: second-pass review template.67- `references/retry-protocol.md`: retry once, then document failure handling.68- `references/non-negotiable-behaviors.md`: hard integrity rules.69- `references/self-reflection-quality-gate.md`: 1-10 scoring rubric with ≥8 threshold.70- `references/self-learning-system.md`: Lesson/Memory templates and governance rules.7172## Gotchas7374- **Do not let confidence replace evidence**: expert intuition can prioritize investigation, but it cannot be the evidence for a finding.75- **Do not hide inaccessible scope**: document files, services, or tools that could not be examined.76- **Do not create memories for routine facts**: use the self-learning governance rules and avoid storing sensitive information.7778## Output template7980```markdown81### Audit integrity gate8283**Status:** pass | revise required | blocked84**Scope reviewed:** `<analysis artifact or agent run>`85**Self-reflection minimum score:** `<lowest category score>/10`8687| Gate | Result | Evidence |88| --- | --- | --- |89| Clarification Protocol | pass/not needed/fail | `<scope decision>` |90| Anti-Rationalization Guard | pass/fail | `<example checked>` |91| Self-Critique Loop | pass/fail | `<changes made or reason none>` |92| Retry Protocol | pass/not needed/fail | `<retry evidence>` |93| Non-Negotiable Behaviors | pass/fail | `<citation/gap evidence>` |94| Self-Reflection Quality Gate | pass/fail | `<scores>` |95| Self-Learning System | pass/not needed/fail | `<lesson or memory decision>` |9697**Required revisions**98- `<revision before delivery, or none>`99```100101## Quality gate102103- [ ] All 7 components were applied unless a component was explicitly out of scope.104- [ ] Ambiguous scope used the Clarification Protocol before analysis.105- [ ] The Anti-Rationalization Guard was applied to unsupported assumptions.106- [ ] A second-pass Self-Critique Loop was completed.107- [ ] Tool failures were retried once and documented if still unresolved.108- [ ] Non-Negotiable Behaviors are satisfied: no fabrication, cited evidence, and reported gaps.109- [ ] Every Self-Reflection Quality Gate category scored ≥8.110- [ ] Lesson/Memory and Lessons/Memories creation followed governance and excluded sensitive information.