HK-hub/AgentSkills / ax-audit
ax-audit
VerifiedAudits agentic applications for architecture and trust: tool parity, tool granularity, context injection, completion signals, approval gates, confidence cues, escape hatches, intent handshakes, memory visibility, and adaptive canvases. Produces a ship-readiness verdict plus an AX Relationship Summary. Use when reviewing agentic feature PRs or asking "is this agent-native", "AX review", "critique this AI feature", "does this earn user trust", or "audit this for AX". For traditional frontend UX use ui-audit.
rules-arch/comm-no-approval-gate.md
View on GitHub---
title: High-stakes irreversible action with no approval step
slug: comm-no-approval-gate
category: comm
defaultTier: release-blocker
surfaces: agent-tool-execution, agent-chat
agent-native-principle: Parity (agent-UI communication)
detection: hybrid
related: comm-no-progress-visibility
---
## High-stakes irreversible action with no approval step
Agent autonomously sends email, deletes files, or publishes content with no confirmation. The user discovers it after the fact: trust destroyed. Violates Parity: stakes and reversibility must determine oversight level, not agent confidence.
## What goes wrong
User says "clean up my inbox." Agent archives 200 emails including an unread message from the CEO. Or: "deploy the fix" and the agent pushes to production without showing what changed.
## Detection
**Surfaces:** agent-tool-execution, agent-chat
**Static signals:**
1. Find tool execution handlers.
2. Identify destructive/financial/external operations: send, delete, publish, deploy, charge, transfer.
3. Check for confirmation dialog or approval handler between decision and execution.
4. Flag direct execution of high-stakes operations with no gate.
**Runtime signals:** Agent executes destructive tools with no preceding user confirmation.
**Concrete commands:**
```bash
rg '(name|toolName).*["'"'"'](send|delete|remove|publish|deploy|charge|transfer)' --type=ts src/
rg '(executeTool|callTool|invokeTool)' --type=ts -A 10 src/ | rg -v '(confirm|approve|requireApproval)'
rg '(requireApproval|confirmBefore|approvalGate|stakesLevel)' --type=ts src/
```
**False-positive guards:**
- Skip files with `// ax-audit-ignore:comm-no-approval-gate`.
- Skip read-only operations (get, list, search, fetch).
- Skip operations marked safe/reversible in tool metadata.
- Skip test files and fixtures.
## Fix
Stakes x reversibility matrix: low+easy = auto, low+hard = quick confirm, high+easy = suggest with diff, high+hard = explicit modal.
```tsx
// before
async function executeTool(tc: ToolCall) {
return tools[tc.name].execute(tc.args);
}
// after: approval gate based on stakes and reversibility
async function executeTool(tc: ToolCall, onApproval: ApprovalHandler) {
const tool = tools[tc.name];
switch (getApprovalLevel(tool.stakes, tool.reversibility)) {
case "auto": return tool.execute(tc.args);
case "quick": await onApproval({ type: "toast", timeout: 5000 }); return tool.execute(tc.args);
case "suggest": await onApproval({ type: "diff", diff: await tool.preview(tc.args) }); return tool.execute(tc.args);
case "explicit": await onApproval({ type: "modal", requireConfirm: true }); return tool.execute(tc.args);
}
}
```
## Default tier and overrides
**Defaults to:** `release-blocker`
| Surface | Tier |
|---|---|
| Agent tool execution | release-blocker |
| Agent chat | release-blocker |
| Agent config | fix-this-sprint |
| Agent dashboard | fix-this-sprint |
## Examples
**Anti-pattern (fails):** `execute: async (args) => emailClient.send(args)`: no confirmation.
**Applied (passes):** Tool declares `stakes: "high", reversibility: "hard"`: gate applied automatically.
## Suppression
```tsx
// ax-audit-ignore:comm-no-approval-gate, internal cleanup, operates only on temp files
const cleanupTool = { execute: (args) => fs.rm(args.tempDir) };
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |