Skip to content

Security & Trust

ostk layers policy, process isolation, local audit, and identity evidence around operations routed through the kernel. Coverage depends on the integration: native client tools bypass the kernel, audit signing requires a key, and process identity is stronger than a self-asserted client name.

Defense-in-Depth Model

Security in ostk does not rely on one boundary. Four containment and audit layers apply where the selected platform and client route an operation through the kernel:

TOOL_LAYER
Deny-based capability pins check kernel-mediated calls against configured tokens and path boundaries before execution.
SYSCALL_LAYER
When enabled and supported, Landlock (Linux) or Seatbelt (macOS) adds process-level filesystem restrictions. Platform and launch path determine coverage.
AUDIT_LAYER
Kernel dispatches append local JSONL rows. Rows are hash-chained and are Ed25519-signed when a signing key is available; unsigned rows remain explicit.
SECRET_LAYER
The kernel secret resolver avoids injecting values into model context and masks known values from kernel-mediated output. Native shell access and external services remain separate boundaries.

Identity-Derived Trust Tiers

At boot, ostk resolves SIGN evidence from the HUMANFILE together with verified primefile identity evidence, then uses legacy GPG resolution as a fallback. The resulting T0–T3 tier supplies the default posture for kernel-mediated operations:

IDENTITY_DEFAULTS OPEN_FULL_SIZE ↗
Identity evidence mapped to ostk T0 through T3 default postures without exposing real keys or operator fingerprints
Identity selects a default posture; configured write: prefixes can declare explicit path exceptions. Scope: Boot-time T0–T3 resolution from HUMANFILE and verified primefile evidence, with GPG as a fallback. Scroll horizontally or open the full-size SVG to inspect every label.
T0
Verified Trust Root
A verified self-sovereign primefile or a trusted Ed25519/GPG anchor
No tier-default restrictions — full governance authority
T1
T0-Endorsed Identity
Verified delegated evidence or a legacy T0 cross-signature
Source writes with kernel-state and governance restrictions by default
T2
Identity Without T0 Endorsement
Identity evidence resolves without trusted endorsement
The governed src/ root, kernel state, and governance are denied by default
T3
Anonymous Mode
No identity resolves from HUMANFILE, verified primefile, or keyring
Kernel-mediated writes denied by default

How Identity Is Admitted

A new project can establish a verified local root through the self-sovereign primefile created by ostk init. Current identity evidence uses Ed25519/DSSE-compatible verification where available; existing environments can retain the legacy GPG fallback.

On the legacy GPG fallback, a verified T0 cross-signature yields T1 and an unendorsed key yields T2. T3 applies only when no verified primefile or other recognized identity evidence resolves. Revocation remains a policy state for historical verification; the boot resolver itself reports T0–T3.

Capability Pins & Profiles

Trust tiers provide the default posture, while an operator-authored pin profile can add deny tokens and verb rules or declare narrow write: prefixes as explicit path carve-outs. Enforcement depends on the execution surface; for fs_ops, an active pin that cannot be read makes writes fail closed.

CAPABILITY_SURFACES OPEN_FULL_SIZE ↗
Effective ostk capability policy branching into file-write checks, kernel-verb denies, and shell containment rather than one universal allow-or-deny path
The effective policy is enforced differently by write, verb, and shell surfaces. Scope: Kernel-mediated operations only; native client tools remain outside this boundary. Scroll horizontally or open the full-size SVG to inspect every label.
CAPABILITY_TOKEN
AFFECTS
DESCRIPTION
deny: write-kernel
.ostk/ state
Blocks canonical kernel-state writes; derived index and round-table paths have explicit exceptions
deny: modify-governance
Governance files
Blocks .primefile, HUMANFILE, GOVERNANCE.md, ENTITYFILE, Agentfiles, and agent definitions
deny: write-src
Project source
Blocks writes under the governed project root's src/ tree
write: <path>
Path prefix
Declares an operator-authored allow override for the listed prefix
deny-verb: <cmd>
Kernel verbs
Blocks an exact invocation or a prefix match at a word boundary

Bounding a Worker Profile

Create custom profiles inside .ostk/pins/<name>/pin.caps and activate them via the OSTK_PIN environment variable:

TERMINAL
$ ostk issue_pin fix-bug
pin fix-bug issued
  .ostk/pins/fix-bug/pin.boot
  .ostk/pins/fix-bug/pin.caps

$ cat .ostk/pins/fix-bug/pin.caps
read: .ostk/ .language
write: .ostk/store/fix-bug/
execute: shell(readonly)
deny: write-kernel modify-governance

# Activate this profile for a supported launch path
$ OSTK_PIN=fix-bug ostk run .ostk/agents/fix-bug.af

Empirical Bounding with ostk learn

If you do not know what paths your worker needs, run it in observation mode to extract the minimal required permissions automatically:

TERMINAL
$ ostk learn .ostk/agents/fix-bug.af --duration 120
LIMIT read-path src/ tests/ Cargo.toml
LIMIT write-path src/ tests/ target/
LIMIT verb cargo build cargo test

# Automatically apply the suggested LIMITs back into the Agentfile
$ ostk learn .ostk/agents/fix-bug.af --apply

The Seven-Step Approval Chain

The embedded CPU agent loop uses this ordered approval chain for its tool calls, from pin caps to any required operator approval. It is not the universal dispatch path for every System ABI verb, and native client tools do not enter it. First matching rule wins within that loop:

01

PIN_CAPS_HARD_DENY

Checks write capabilities against pin.caps. If matching write-kernel, modify-governance, or write-src, it is denied immediately. Fails closed.

02

DESTRUCTIVE_CHECK

Runs destructor checks on command strings. Dangerous commands (e.g. rm -rf) or active danger signals override all auto-approval paths and force a prompt.

03

KERNEL_READ_AUTO

If the command is exactly a read-only kernel inspect primitive (e.g. ostk ps, ostk clock, ostk show), it is automatically approved without prompts.

04

PERMISSION_MODE_GATE

Checks the active permission mode. Autonomous allows all; Auto allows standard reads plus ordinary edit/write classes; Governed and Plan deny write classes by default.

05

SESSION_ALLOW_LIST

Checks transient in-memory approved verbs. If the operator approved a tool class with the "approve all" key, it is auto-approved until the session ends.

06

AGENTFILE_TOOL_PATTERNS

Compares the call target against Agentfile TOOL directives. Substring matches approve specific file paths or command classes.

07

USER_PROMPT

Falls back to prompting the human operator. Keybindings: y=approve, n=deny, a=approve class, Enter=deny (safety default).

Secrets Management & Masking

When a supported tool resolves credentials through ostk, the kernel avoids placing the value in the model prompt, resolves it at execution time, and injects it only into the active subprocess environment. Native shells and external services remain separate boundaries:

01
BYO_SECRET_MANAGER
User-defined secret_cmd inside .ostk/config (e.g. bw, op, pass). Env var injections are blocked here to prevent exfiltration.
02
PLATFORM_KEYCHAIN
Uses OS native keychain services: security find-generic-password on macOS, secret-tool lookup on Linux.
03
ENVIRONMENT_VARIABLES
Standard shell environment fallback ($KEY). Least secure—visible in process tables.

Interactive Secrets Administration

TERMINAL
# Securely write a secret to the keychain
$ ostk secret set ANTHROPIC_API_KEY
Enter value: ●●●●●●●●
✓ stored in macOS Keychain (service: ostk, account: ANTHROPIC_API_KEY)

# List stored secrets
$ ostk secret list
ANTHROPIC_API_KEY    ✓ keychain
GEMINI_API_KEY       ✓ keychain
OPENROUTER_API_KEY   ✗ not found

Output Masking

Kernel-mediated results on supported masking paths pass known values through secrets::mask() before they are returned to the model. This does not sanitize output produced through native client tools or unrelated external processes.

Any string matching a known API key structure with length ≥ 8 characters is automatically replaced with ●●●● (length).

Verifiable Audit Chains

Kernel-mediated dispatches append entries to the local journal (.ostk/journal.jsonl). Native client actions that bypass ostk are not covered. Appended rows are:

  • Hash-chained: Contains the SHA-256 hash of the preceding line (prev_hash).
  • Conditionally signed: Ed25519-signed in process when the kernel signing key is available; otherwise sig is empty.
  • Verifiable within scope: The hash chain and present signatures can be checked. Replay rebuilds supported registries and projections, not every byte of runtime history.
TERMINAL
# Cryptographically audit the local journal
$ ostk audit check
audit: 18,442 rows, hash chain ok, present signatures verified, unsigned rows reported

# Inspect the running log
$ tail -f .ostk/journal.jsonl
{"event":"tool.fs_ops","path":"src/lib.rs","gen_before":4,"gen_after":5,"writer":"claude-code-1","ts":"2026-05-22T21:42:11Z","prev_hash":"...","sig":"..."}
{"event":"tool.bash","cmd":"cargo test","exit_code":0,"duration_ms":1842,...}
CONCURRENCY & OCC INVARIANTS

fs_ops CAS edits provide expected text and use generation history to detect stale or overlapping work. Safe non-overlapping changes may auto-merge; ambiguous changes fail visibly. Native client writes, raw shell writes, and overwrite-style operations do not inherit this OCC guarantee.

Signed Portable State (Bail)

A bail is a signed, compressed archive (.bail) whose contents depend on the selected public, full, or export mode. It can transfer the state explicitly included in that package between instances; it is not a blanket export of external harness sessions, runtime-only state, or every derived index.

PUBLIC_MODE

Contains public bootstrap states (.boot/INIT, .primefile, ENTITYFILE). Signed with Ed25519. Safe to share publicly.

FULL_MODE

Adds encrypted internal kernel database (os.bin). Requires recipient key declarations. Unpack is strictly fail-closed on signature mismatches.

EXPORT_MODE

Selective export of needles, decisions, and markdown docs. Recipient merges items labeled with [I] import markers. GPG-signed.

Bail Administration Commands

ostk bail pack Pack full encrypted bundle. Defaults to public mode if no recipient key is configured.
ostk bail pack --public Pack public bootstrap files (.boot/INIT, .primefile, ENTITYFILE).
ostk bail pack --export @identity Export selective needles, decisions, and docs matching a query.
ostk bail verify <file> Cryptographically verify all detached signatures inside the bail without unpacking.
ostk bail unpack <file> Verify and merge the bail contents into the local .ostk/ directory.
TERMINAL
# Verify a bail package received from another machine
$ ostk bail verify project-export.bail
ostk bail verify: /tmp/project-export.bail
Ed25519: VERIFIED (inline)
GPG: no manifest.json.asc in bail
  created: 2026-05-22T14:23:10Z
  files:   5

Key Rotation & Revocation

If a private key is compromised, it must be revoked without invalidating historical signatures. Revocation uses the following workflow:

01
Execute ostk trust revoke <fingerprint>, signed by a valid authority key (T0 or T1).
02
The revocation event is written to the journal, binding the compromised fingerprint.
03
The kernel reads the revocation list at boot. All actions signed by the key BEFORE the revocation timestamp remain valid; future actions are rejected.
04
The operator creates fresh supported identity evidence and re-establishes the required endorsement. Legacy deployments may use the GPG cross-signing path.
TERMINAL
# Record a key revocation
$ ostk trust revoke 7141A45868F8295E5BEB6286BAF08C963C7E3184 --reason "leak"
✓ Revocation registered

# Generate a new key and request cross-signing
$ gpg --full-generate-key
$ ostk trust sign <new-fingerprint>