interface · Browser and Node

# PolicyInput

The policy's input (§8.5). Logged with a decision, it lets anyone re-run it with `evaluate`.

`@toip-tools/mandates` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/mandates/src/engine.ts#L36)

Import:

```ts
import { type PolicyInput } from "@toip-tools/mandates";
```

## Declaration

interface:

```ts
interface PolicyInput {
  nowS: number;
  action: Pick<Action, "type" | "attrs"> & Partial<Action>;
  actionHash: string;
  chain: LinkFacts[];
  /** Reasons from steps 1 to 8, and presentation problems. */
  structural: Reason[];
  /** Problems with approvals; those approvals are left out of `approvals`. */
  approvalProblems: Reason[];
  state: { spent: Record<string, Partial<Record<Period, Units>>> };
  /** Approvals whose signatures and bindings TypeScript checked. */
  approvals: { id: string; approverLink: number; actionHash: string; validUntilS: number; used: boolean }[];
  requirements: Omit<Requirements, "maxStatusAgeSeconds">;
  facts: { rootCredentials: string[]; passport?: { issuer: string; subject: string } | null };
  options?: { skipNarrowing?: boolean };
}
```

## Properties

**`nowS` (required)**

`number`

**`action` (required)**

`Pick<Action, "attrs" | "type"> & Partial<Action>`

**`actionHash` (required)**

`string`

**`chain` (required)**

`LinkFacts[]`

**`structural` (required)**

`Reason[]`

Reasons from steps 1 to 8, and presentation problems.

**`approvalProblems` (required)**

`Reason[]`

Problems with approvals; those approvals are left out of `approvals`.

**`state` (required)**

`{ spent: Record<string, Partial<Record<Period, Units>>>; }`

**`approvals` (required)**

`{ id: string; approverLink: number; actionHash: string; validUntilS: number; used: boolean; }[]`

Approvals whose signatures and bindings TypeScript checked.

**`requirements` (required)**

`Omit<Requirements, "maxStatusAgeSeconds">`

**`facts` (required)**

`{ rootCredentials: string[]; passport?: { issuer: string; subject: string; } | null; }`

**`options` (optional)**

`{ skipNarrowing?: boolean; } | undefined`

[Usage guide](https://toip.tools/toolkit/mandates/#usage) · [Error handling](https://toip.tools/toolkit/mandates/#errors) · [All exports](https://toip.tools/toolkit/mandates/api/)

---

This is the Markdown version of https://toip.tools/toolkit/mandates/api/PolicyInput/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
