> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Project policy ladders

> Resolve run ceilings, trace retention and provenance through explicit precedence.

> [!NOTE]
>
> **Live project control plane.** The released engine
> discovers `nika.yaml` from the working directory toward its
> ancestors. The file is optional when built-in defaults are enough. Its
> project-shape grammar is closed: `nika` ·
> `ceiling` · `arm` · `traces` ·
> `registry`. Direct runs and the cadence path
> (`nika arm` · `nika serve`) read the same file.

> [!TIP]
>
> **One client, local by default.** Import `Nika` from
> the package root and omit `url`. The client takes the engine
> from `bin`, then `NIKA_BIN` (both absolute paths), then
> the platform package npm installed with it; it never uses a
> `nika` found on your `PATH`. These examples target
> the published [0.124.4 SDK release](https://github.com/supernovae-st/nika-client/tree/v0.124.4).

The SDK does not replace project policy. It supplies the invocation rung and
the working directory that lets the engine discover the rest.

## Run spend

SPEND LADDER · CLOSEST EXPLICIT DECISION WINS

<pre tabIndex="0">
  Nika run maxCostUsd / --max-cost-usd
  &#x20;                   ↓ wins
  &#x20;   nika.yaml ceiling
  &#x20;                   ↓ otherwise
  &#x20;   engine built-in posture

  &#x20;   arm\[].plafond = required for every scheduled tick
</pre>

```ts theme={"system"}
const run = await nika.run('workflows/release.nika', {
  maxCostUsd: requestBudget,
})
const result = await run.result()
```

`maxCostUsd` is invocation-specific. Keep the project default in `nika.yaml`
instead of copying it into every application call.

## Trace retention

```yaml theme={"system"}
nika: my-project

traces:
  keep: 30d
```

The matching `NIKA_TRACE_*` environment knob wins over the project retention
rung, then the engine default applies. This lets an immutable project run
under different operational retention obligations.

## Registry provenance

```yaml theme={"system"}
nika: my-project

registry:
  floor: provenanced
```

The project floor max-composes with the operator policy under `~/.nika`. A
repository can demand stronger provenance. It cannot weaken the machine
owner's floor.

> [!NOTE]
>
> In 0.124.3 a first fetch of a `registry:` coordinate is refused
> (`NIKA-REG-005`) whatever the floor says: take the workflow file from the
> registry repository and use it by path
> ([Known limits](https://docs.nika.sh/changelog/known-limits.md#registry-coordinates-are-refused)).

```text theme={"system"}
operator floor ─┐
                ├── maximum ── admitted artifact tier
project floor ──┘
```

## Keep one owner per decision

| Decision | Owner |
| - | - |
| Project default spend | `nika.yaml ceiling` |
| Request-specific spend | `Nika.run()` call or CLI flag |
| Scheduled tick spend | `arm[].plafond` |
| Retention by host | Environment or project `traces.keep` |
| Artifact provenance | Maximum of operator and project floors |
| Workflow authority | The workflow's own `permits:` and `secrets:` |

> [!WARNING]
>
> Do not create an application `nikaConfig` object that mirrors every project
> key. That produces a second control plane with no precedence contract.
> Construct `Nika` once with `cwd`; pass only invocation-specific inputs,
> model and ceiling per run. Cancellation is the separate `run.cancel()` verb.

## Continue

> [card] [SDK configuration](https://docs.nika.sh/sdk/reference/configuration.md)
>
> Constructor and call-level options.

> [card] [Security boundary](https://docs.nika.sh/sdk/operations/security.md)
>
> Permits, secrets, argv and cancellation.

> [card] [Project file](https://docs.nika.sh/sdk/project/nika-yaml.md)
>
> The closed grammar behind these ladders.

> [card] [Arm registry](https://docs.nika.sh/sdk/project/arm-registry.md)
>
> Per-tick money and missed-run policy.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.