Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt

Use this file to discover all available pages before exploring further.

What is a policy?

A policy is a JSON file that defines the rules governing a category of decisions. Policies declare the signals they accept, the rules that evaluate those signals, and the outcomes each rule produces. Rules are evaluated in order - the first matching rule wins.

Policy file structure

Policies live at policies/{policyId}/{policyVersion}/policy.json.
{
  "policyId":     "loan-approval",
  "policyVersion": "1.0.0",
  "schemaVersion": "1.0.0",
  "signalsSchema": {
    "credit_score": { "type": "integer" },
    "loan_amount":  { "type": "integer" },
    "employed":     { "type": "boolean" }
  },
  "rules": [
    {
      "id": "reject-low-score",
      "condition": { "signal": "credit_score", "less_than": 500 },
      "outcome": {
        "action": "reject",
        "requires_override": false,
        "reason": "Credit score below minimum threshold."
      }
    },
    {
      "id": "approve-standard",
      "condition": { "signal": "credit_score", "greater_than": 700 },
      "outcome": {
        "action": "approve",
        "requires_override": false,
        "reason": "Credit score meets standard threshold."
      }
    },
    {
      "id": "catch-all",
      "condition": { "all": [] },
      "outcome": {
        "action": "manual_review",
        "requires_override": true,
        "reason": "Credit score requires manual review."
      }
    }
  ]
}

Rule evaluation

Rules are evaluated top to bottom. The first rule whose condition matches the provided signals wins. Remaining rules are not evaluated. Always include a catch-all rule ("all": []) as the last rule to handle all unmatched cases. The compiler warns if one is missing (POL-021).

Condition operators

OperatorSignal typesExample
greater_thaninteger, number{ "signal": "amount", "greater_than": 1000 }
less_thaninteger, number{ "signal": "amount", "less_than": 500 }
equalsany{ "signal": "tier", "equals": "premium" }
all-{ "all": [cond1, cond2] } - matches when all sub-conditions match
any-{ "any": [cond1, cond2] } - matches when any sub-condition matches
all: []-{ "all": [] } - catch-all, always matches

Outcome actions

ActionDescription
approveDecision approved
rejectDecision rejected
escalateEscalate to higher authority
manual_reviewRequires human review
auto_approveAutomatic approval
document_requiredMore documentation needed
fraud_reviewRoute to fraud team
pending_overrideOverride required before execution

Policy bundles

Before a policy can be used in production, it must be compiled and signed into a content-addressed bundle:
# Validate all 8 compilation phases
npx parmana policy compile ./policies/loan-approval/1.0.0

# Compile and sign
npx parmana policy build ./policies/loan-approval/1.0.0
The bundle produces bundle.manifest.json and bundle.sig. The bundle hash is deterministic - the same policy content always produces the same hash.

Versioning

Policy versions use semver format (1.0.0, 2.0.0). The v1 prefix format is not supported. Once a version is signed, it is immutable - update a policy by creating a new version. See Policy Versioning.

See also