Security model and threat analysis

September 20, 2026 ยท View on GitHub

This project is an experimental classifier integration. It is not an independently audited security product and does not guarantee correct authorization judgments.

Assets and trust boundaries

Protected assets include user data, credentials, repository integrity, production resources, policy configuration and the meaning of a user's authorization. The native Codex host and its administrator configuration are authoritative. Repository content, tool arguments, model output, comments, tool descriptions, and retrieved text are evidence, not authorization.

The Python launcher, installed package, configuration, daemon token and audit directory must be controlled by the operator, outside agent-writable locations. The protocol's source field is not a signature. A same-user process with sufficient filesystem/environment access can tamper with the integration; a dedicated service account or stronger operating-system isolation is needed against that threat.

Principal threats and controls

ThreatImplemented controlResidual limitation
Prompt injection in repository/tool textReuse host provenance; explicit question trust boundary; hazard/defer routeThe classifier itself can still be wrong or manipulated
Forged user authorization in agent proseHost-derived evidence and revision checks; no transcript scrapingMeaning still requires model judgment
Cached or replayed approvalNo new approval cache; request ID and snapshot bindingSame host authority can forge protocol input
Authorization change during inferenceExtra native version/policy recheck plus existing Codex checkArbitrary filesystem changes are not identical to auth revisions
Model/version driftVersioned ID required; exact response model checkA model ID does not prove stable server-side internals
Malformed API outputStrict keys/types/ranges/distributions; no coercion to allowLive provider contract not exercised in this build
API failure or rate limitBounded timeout and original-review fallbackFallback latency can be worse than baseline
Sensitive state disclosureExplicit consent, fixed HTTPS endpoint, no redirects/proxies, literal-secret blockNot comprehensive DLP; proprietary context may still be submitted
External localhost-service callerLoopback-only binding and random bearer tokenLocal malware can steal a bearer token
Untrusted hook inputPackaged hook always abstainsOther pre-existing hooks retain their upstream behavior
Dangerous high-risk actionLow-risk-only fast allow; supported category limitLow-risk misclassification remains a false-allow risk
Operator/config driftExact policy/question hash pins; guarded source installerHash pinning is not review or semantic correctness
Audit leakNo raw prompts, commands, keys or provider errorsHashes permit correlation and dictionary guessing

Rules that the implementation must preserve

An absent answer, unknown value, timeout, missing model key, audit failure, low confidence, unknown authorization, unsupported medium, or expired snapshot must never become a new auto-approval. A proposed denial requires a policy violation; intrinsic risk alone is not an unauthorized action. A classification result must not expand permissions or rewrite the proposed action.

Native v0.1 refuses to replace mandatory/fresh review, retries or sandbox escalation. Network access, permission expansion, stdin, Unix interception and MCP/computer-use remain on their original paths. This narrow boundary is intentional, not evidence that those categories are unimportant.

Why not use an approving PermissionRequest hook?

The inspected Codex hook path can decide before Guardian. Its public input is not the full native captured policy/authorization context. A hook that assumes missing state is safe, synthesizes a mandatory_review=false flag, or treats agent-provided explanations as trusted would weaken the intended architecture. The packaged hook therefore abstains even when otherwise configured to enforce.

Why not trust confidence alone?

A concentrated distribution can be confidently incorrect. The package requires multiple signals, version and policy pins, supported scope and empirical rollout validation. These are risk-reduction measures, not a theorem about classifier correctness. Correlated questions do not supply independent statistical guarantees, and hazard probabilities must not be multiplied as though they were independent.

Shell and filesystem caveats

The engine does not parse all shell languages or prove arbitrary program behavior. Expansions, environment overrides, aliases, hooks, symlinks, downloads, mutable scripts, build-system side effects, hidden egress and chained operations need dedicated adversarial coverage. Existing sandbox enforcement and Guardian's investigation remain important. Do not regard git, python, a build command or a read-like tool name as inherently safe.

Configuration and lifecycle

The default config is shadow plus remote submission disabled. Live credentials do not themselves authorize data processing. Enforcement requires deliberate policy/question pins and action-category selection. Pin changes should be code-reviewed, with independent holdout evaluation. No automatic optimizer updates deployment configuration.

To immediately remove this component from routing, unset the three native launch environment variables and restart the patched Codex process. Preserve the existing Guardian path. Revert source changes only after inspecting intervening work.

Validation required before production

A real Rust build and native integration tests are still outstanding. Tests must cover policy precedence, stale root/local authorization, concurrent approvals, history reset, process cancellation, process/output resource limits, platform-specific paths, and failure under actual Codex invocation. Live TypeSafe tests must cover malformed and ambiguous inputs, known prompt-injection patterns, distribution shifts and independently labeled false allows.

The archive's scripted tests do not satisfy these production gates.