Skip to the content.

Threat Model

coding-ethos protects repository workflows used by humans and AI coding agents. The project assumes agents can make mistakes, overfit to local context, or attempt unsafe tool use when prompts, hooks, and policy drift apart.

Protected Assets

Actors

Trust Boundaries

Boundary Enforced by
User prompt to agent tool call agent hook policy checks
Shell command text to execution shell parser, CEL, and compiled policy
File edit request to filesystem write file policy, protected path rules, and CEL
Raw linter to managed lint result toolcatalog, generated config checks, capture normalization
Repo config to enforcement bundle config validation and policy compilation
Local findings to CI evidence SARIF generation and upload workflows
Managed tool execution to host OS sandbox mode, capabilities, timeout, cgroup, and seccomp metadata

Primary Risks

Hook Or Git Bypass

Agents may try alternate Git paths, hook bypass flags, shell wrappers, or subprocess indirection. The safe path is the coding-ethos Git wrapper plus compiled hook policy. Bypass attempts are treated as enforcement failures, not as normal workflow errors.

Protected Enforcement Point Writes

Agent memory and plan files should be writable, but hook definitions, managed settings, policy bundles, generated tool configs, and enforcement bootstrap paths require stronger protection. Policies should prefer inverse allow models: agent workspaces are writable except for explicit enforcement points.

Malformed Shell Text

Shell text is parsed before policy evaluation. Malformed commands are denied instead of treated as compatibility cases because partial parsing creates policy gaps.

Tool Capability Drift

Linters and other managed tools can gain network, Git, environment, or writable path behavior over time. Runtime capability metadata makes those requirements visible to CEL, MCP, traces, SARIF, and reviews.

MCP Misuse

The MCP server is advisory context and managed execution, not a bypass around Git hooks or agent hooks. MCP clients receive policy, lint, SARIF, and skill context from the same compiled bundle used by enforcement paths.

Sandbox Overclaiming

Sandboxing is defense in depth. Required sandbox mode fails closed when the backend is unavailable; advisory mode records degraded evidence. Documentation and SARIF evidence must distinguish requested controls from controls actually enforced.

Out Of Scope

Defense In Depth