Skip to main content
Workflows run attacker-influenced inputs by nature: they fetch URLs, shell out, and feed model output into tools. Nika’s position is that the mechanism must be safe before policy makes it configurable: the dangerous primitives ship hardened by default, and a violation is a typed NIKA-SEC-* error your workflow can read, not a stack trace.

The threat model in one table

Permits — declare the blast radius

On top of the hardened mechanisms, a permits: block makes the file itself declare its blast radius. Four families, one shape:
Two laws govern it:
  1. No permits: block → zero authority, not an unrestricted floor. Hardened defaults (SSRF, shell blocklist, secret masking) still apply, and they do not grant exec, net, fs, or tools. On 0.124.3, exec: { command: ["printf", "hello"] } with no permits: is NIKA-AUTH-006 at check, exit 2. Spec 01-envelope · LAW-AUTH-0324.
  2. Any permits: block → default-deny for the whole file. Anything not listed is refused. A task reaching beyond the boundary is caught by nika check (NIKA-SEC-004 or NIKA-AUTH-006, with the exact fix) and again at run time.
A file whose bytes reach a model provider is a read like any other. An infer: task’s vision: image with source: file is admitted only by permits.fs.read, on an API route and on an agent application’s seat alike, in a child workflow and in a rehearsal: NIKA-AUTH-006 under an absent block, NIKA-SEC-004 outside a declared one. nika check judges a literal path, or a whole bare const reference, and lists it in --infer-permits; it refuses a computed path under a boundary that grants no read at all. The run reads every file itself, on its resolved path, before any provider call. A workflow that sent a vision file with no grant before 0.124 must now grant it. A source: url image is not an fs effect: the provider fetches it and Nika never does, so it needs no fs or net.http grant, and permits: {} admits it (Verbs).

The file is the boundary. The permits: block, drawn as a map of what each task may reach. One task fetches a host outside the fence: nika check refuses the file (NIKA-SEC-004) and names the one-line fix. Widen the fence on purpose and the same check says the file is ready to run. Output captured from the real CLI on nika 0.121.0; the map is drawn from the file.

Predict: a file with one exec: and no permits: — does it run? It does not. nika check --infer-permits prints the tightest block to paste. Infer-only mock/echo with permits: {} is the declared zero, and that is enough for a first run.
You never have to write it by hand: nika check --infer-permits computes the tightest boundary the file actually needs and prints it, ready to paste. The SSRF floor below stays on regardless of permits — a permitted host still cannot bounce into private space.

SSRF defense (on by default)

nika:fetch refuses to be bounced into private space. Three layers, verbatim from the engine (nika-http):
1

Static checks (pure)

Scheme allow-list (http/https only), blocked hostnames, and range checks for implicit loopback, RFC 1918, link-local/metadata (169.254.169.254), CGN, IPv6 local, v4-mapped v6. Spec 01-envelope Exact-loopback declassification: the only SSRF carve-out is an exact permits.net.http literal — the closed set localhost, a 127.x.y.z v4 literal, or ::1 / [::1]. Clearing is exact-host: a permitted localhost does not clear 127.0.0.1 (on 0.124.3, that grant with a fetch to 127.0.0.1 is NIKA-SEC-005 at check; an exact 127.0.0.1 grant passes); a public name that resolves to loopback stays refused; RFC1918 / metadata named in the list stay floor-blocked (NIKA-SEC-005).
2

DNS resolution check

Non-literal hosts are resolved and every address is range-checked: this kills decimal-IP tricks (http://2130706433/) and public names that resolve to private addresses.
3

Per-hop redirect re-check

Client-level redirects are disabled; the engine follows redirects itself and re-runs layers 1+2 on every hop. A public host cannot 302 the client into your VPC.
Response sizes are capped (64 MiB default) and self-signed TLS is rejected by default. Private-network access is opt-in configuration, never the default.

exec: the order law (NIKA-SEC-015)

Content the workflow did not author must never reach a shell. An exec: task that sits downstream of a nika:fetch or nika:notify task, over a with: data edge or an after: control edge, is refused at check, whatever the channel: an argv element, stdin:, or no data at all. No permits: entry and no lift: can open this law.
fetch-then-shell.nika
Do the work in a builtin instead. Here the fetch extracts with mode: jq and a builtin writes the result, with no shell anywhere:
fetch-then-transform.nika
For values that may reach exec: (a caller’s inputs, a model’s answer), keep them in data channels: argv elements, each substituted on its own with no shell to break out of, or stdin:; never a shell: string. The resolved program must still match permits.exec: a model that answers a program name the allowlist does not hold fails the run with NIKA-SEC-004.

One authored door: lift: (two laws)

Some legitimate workflows do need to cross one of these lines. Nika refuses to let that happen silently: there is exactly one door, lift:, authored, naming the law it opens, requiring a written justification, recorded in the run receipt.
Each entry lifts one law and nothing else. law: taint does not widen permits: — the value is still matched against the declared boundary, so it can never become a permit bypass, and there is no implicit declassification. law: data-as-code does not touch the net.http boundary or the SSRF floor. (declassify: and inert: were the two earlier spellings; both merged into lift: in 0.109 — the law is a parameter of one door, not two keywords.) Because it is one plain YAML key, grep -rn 'lift:' over a repo returns every place a law was opened, with the reason attached. That is the point: the escape hatch is auditable by construction.

Prompt injection: the boundary checks

Nika does not try to detect injected instructions in text. It bounds what a model that has read untrusted content can make happen, with checks that hold whatever the model decides: Every failure is a typed error with a stable code and a transient flag; on_error: can act on it. The catalog lists the full NIKA-SEC namespace.

The trifecta across files and child workflows

The trifecta and the consent law follow untrusted content wherever it travels, not only along one file’s direct edges:
  • Through a file. When a task saves untrusted content to a file, a builtin that reads that path carries the content on: nika:read, nika:grep (its default root . included), nika:glob, nika:edit, a nika:decide bundle, the files nika:image_fx, nika:chart and nika:image_generate read, and a nika:fetch multipart upload. With a literal write path the order does not matter: a read in the writer’s own wave, or before it in the run (the next run reads the file), counts too. Paths compare lexically and case-blind, a templated path may be any file, and a read whose path cannot reach the written one stays clean.
  • Through a child workflow. nika check and nika run judge an invoke: workflow: call as the tasks its child stands for, through every workflow below it. The call brings untrusted content in when content its child fetches, runs or receives from an MCP tool or an agent reaches the child’s outputs or a file it writes. It is an egress when untrusted content reaches an egress inside it: the child’s own, the call’s arguments, or a file written before the call that a child exec: reads. The parent is refused unless a blocking nika:prompt of its own dominates the path; a gate inside the child is not credited to the caller. A child the check cannot read, parse or resolve counts as all of these. The finding names the child task behind the call, and nika check --json lists every direct call under composed_calls.
  • Consent in front of a child. A confirm gate placed before a child workflow call must stop the child’s effect on a « no », as for an inline egress: every route from the gate to the call must close on the refusal (NIKA-SEC-014), and the finding names the call. A bare after: { ask: success } edge does not close it, because a refused confirm also settles with success: bind the answer on the call instead (with: { go: ${{ tasks.ask.output }} } and when: ${{ with.go == true }}). A confirm gate inside the child owns the effect behind it. When the only gate before the effect is one inside the child that the check cannot decide from the caller (a when: on an input the caller may bind to its answer), the call gets the advisory hint instead of the refusal.
  • The run re-judges the calls. The runtime re-derives the trifecta over the child calls the check report resolved. A call the report does not list for its task and target counts as unresolved, and the run refuses it with NIKA-1707, naming it, so a program that pairs its own check with the runtime cannot run a fetching child into an ungated egress. nika run --task re-checks the kept tasks with their children.
A check of the source alone (an editor, the MCP nika_check tool) reads no child: its trifecta judges the parent’s own tasks only. NIKA-DRIFT-001 no longer advises removing a grant a child needs (its program, its tools, the files and hosts its own permits: lets it reach). An infer: task’s vision: entries are followed too. A vision read of a file an untrusted writer left counts in the file channel, untrusted content that picks a vision entry reaches the task’s answer, and a parent must grant the vision files of the children it calls (NIKA-COMP-002).

Secrets

${{ secrets.* }} is a first-class namespace, backed by an environment variable (source: env) or a file (source: file). Secret values are masked before events are written: they never appear in the event stream, and they are not readable back from a task’s recorded output. A secret that reaches any sink without a matching egress: entry is refused (NIKA-SEC-006).

Supply-chain hardening (the engine itself)

  • unsafe_code = "forbid" workspace-wide · zero .unwrap() in src/ (CI-enforced)
  • cargo deny on every PR · cargo audit on every dependency change
  • Sealed kernel traits · external code cannot impersonate engine I/O
  • An AGPL engine of admitted crates plus still pre-admission, some of which ship in the binary (the Session, the terminal workspace, nika serve)
  • Every release ships SHA256 sums, a GitHub build attestation and SLSA provenance (Verify a download)
  • AGPL-3.0-or-later · the source travels with the binary, always auditable

Reporting a vulnerability

security@supernovae.studio (please not via public issues). Acknowledgement ≤72h, triage ≤7 days, disclosure ≤90 days. Security fixes land on main, the only maintenance branch, and ship in the next release: 0.124.x is maintained, and the 0.123.x line, the previous one, receives no further patches. Report against the latest release or main. Full policy, disclosure process and the out-of-scope list: SECURITY.md.

See also

Error codes

The NIKA-SEC namespace + every typed failure.

Bindings

Taint, scopes, and the secrets.* namespace.

Builtins · fetch

The nika:fetch contract (engines MUST ship SSRF defense).

SECURITY.md

Reporting, disclosure timeline, hall of fame.