Skip to main content
KRAIT

The Seven KRAIT Rules

A deep dive into KRAIT-001 through KRAIT-007 — the structural security rules enforced via AST analysis across 6 languages by the Rust NIF.

All 7 rules are enforced across 6 languages (Elixir, Python, JavaScript, TypeScript, Go, Rust) using dedicated tree-sitter parsers in the Rust NIF. Each language has adapted rule implementations that match its specific dangerous patterns.

KRAIT-001: No Code Eval

Dynamic code evaluation is the most dangerous capability an agent can access. KRAIT-001 prohibits all forms of runtime code evaluation:

KRAIT-002: No Shell Execution

An agent with shell access has access to everything. KRAIT-002 blocks shell execution across all languages:

KRAIT-003: No Credential Access

KRAIT-003 uses taint analysis to prevent access to sensitive credential paths. Reads targeting ~/.ssh, ~/.aws, ~/.config, and .env files are tracked through data flow. Even if the path is constructed indirectly — concatenated from fragments or passed through variables — the taint tracker follows it to the source.

KRAIT-004: No Network Exfiltration

Raw HTTP/network access is blocked across all languages:

KRAIT-005: No Hot Code Loading

Dynamic code loading is blocked:

KRAIT-006: No Core Tampering

Certain paths in the KRAIT system are immutable. The supervision tree, the Narsil NIF, the rule definitions, and the core orchestration modules are all protected. KRAIT-006 ensures that file writes targeting these paths are rejected at the AST level.

KRAIT-007: No Recursive Self-Modification

The evolution system is what makes KRAIT unique — and it must be protected above all else. KRAIT-007 prevents the agent from modifying the evolution system itself. The agent can evolve its own task modules, but it cannot alter the mechanism that governs evolution.