code wiki / (root) / nx_ai_audit.nx

nx_ai_audit.nx

buildroot/runtime/nx_ai_audit.nx

6885 B199 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ai_audit.nx -- anti-Ultron AI proposal auditor. Per [[feedback-captain-moroni-doctrine]] Phase M5 + [[feedback-substrate-as-jarvis-anti-ultron]] cardinal: AI agent proposals are audited against capture / manipulation / autonomous- weapon patterns BEFORE the operator decides to act. Substrate never autonomously executes; it surfaces verdicts + reasoning to the human. Naming: avoided `nx_jarvis` (Iron Man trademark proximity); avoided `nx_sentinel` (Microsoft Sentinel collision); `nx_ai_audit` is descriptive + unowned. Per Captain Moroni: substrate refuses to instantiate offensive patterns. The AI auditor's job is to catch them when they appear in proposals an AI agent makes, not to attack the AI. Pattern categories shipped V1: CAPTURE_ATTEMPT -- AI proposes to expand its own privileges PERSUASION_LOOP -- AI doubles down on rejected proposal AUTONOMOUS_WEAPON -- AI proposes lethal physical action SECRET_KEY_EXFIL -- AI asks to read identity-tier secrets DECEPTIVE_ALIGNMENT -- AI says one thing, plans another COLLATERAL_ACCEPTANCE -- AI accepts human harm as side-effect Composes: nx_intent -- AI's declared intent must be checked against proposal nx_drone_doctrine -- AUTONOMOUS_WEAPON proposals refused before reaching nx_drone_doctrine nx_brane -- CAPTURE_ATTEMPT often shows as cap-escalation nx_evict_journal -- every audit verdict logged nx_provenance_chain -- audit decisions are transforms

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_intent.nx nx_ai_audit.nx nx_ai_audit_test.nx nx_tier3_ecology_compose_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_intent.nx

imported by: nx_ai_audit_test.nxnx_tier3_ecology_compose_test.nx

structs

62struct NxAiProposal
73struct NxAiAuditResult

consts

40const NX_AIP_CAPTURE_ATTEMPT: nx_int = 0
41const NX_AIP_PERSUASION_LOOP: nx_int = 1
42const NX_AIP_AUTONOMOUS_WEAPON: nx_int = 2
43const NX_AIP_SECRET_KEY_EXFIL: nx_int = 3
44const NX_AIP_DECEPTIVE_ALIGNMENT: nx_int = 4
45const NX_AIP_COLLATERAL_ACCEPTANCE: nx_int = 5
46const NX_AIP_N_KINDS: nx_int = 6
50const NX_AIA_CLEAN: nx_int = 0
51const NX_AIA_SUSPECT: nx_int = 1 // 1 pattern detected
52const NX_AIA_BLOCKED: nx_int = 2 // 2+ patterns or
54const NX_AIA_OPERATOR_REVIEW: nx_int = 3 // single high-severity
55const NX_AIA_ERR_BAD_INTENT: nx_int = 4

functions

81func nx_aip_is_valid(p: nx_int) -> nx_int
87func nx_aia_verdict_is_valid(v: nx_int) -> nx_int
100func nx_aip_is_blocking_pattern(p: nx_int) -> nx_int
called by 2: nx_ai_auditmain
108func nx_ai_proposal_new(proposal_id: nx_int,
called by 2: mainmain calls 1: sys_mmap
124func _aia_popcount6(x: nx_int) -> nx_int
called by 1: nx_ai_audit
145func nx_ai_audit(p: *NxAiProposal, now_us: nx_size) -> *NxAiAuditResult
194func nx_ai_proposal_has_pattern(p: *NxAiProposal, kind: nx_int) -> nx_int
called by 1: main calls 1: nx_aip_is_valid