> ## 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.

# POST /simulate

> Evaluate a policy without creating an attestation

## Endpoint

```http theme={null}
POST /simulate
Content-Type: application/json
Authorization: Bearer <api-key>
```

`/simulate` evaluates a policy using supplied signals and returns the decision outcome without producing an attestation.

This endpoint is intended for:

* Policy development
* Policy testing
* Sandbox environments
* Rule debugging
* What-if analysis

***

## Why Simulation Exists

Simulation allows teams to understand policy behavior before running production evaluations.

```text theme={null}
Signals
    ↓
Simulation
    ↓
Decision
```

No attestation is issued.

No execution evidence is produced.

No authorization record is created.

***

## When To Use

### Use `/simulate`

For:

```text theme={null}
Policy Testing
Policy Development
Sandbox Evaluation
Rule Validation
What-if Analysis
```

***

### Use `/evaluate`

For:

```text theme={null}
Production Decisions
Authorization
Attestation Generation
Override Workflows
Execution Flows
```

***

## Core Difference

### Simulation

```text theme={null}
Signals
    ↓
Policy
    ↓
Decision
```

***

### Evaluation

```text theme={null}
Verified Signals
        ↓
Policy
        ↓
Decision
        ↓
Signed Attestation
```

***

## Request Body

```json theme={null}
{
  "policyId": "claims-approval",
  "policyVersion": "1.0.0",
  "signals": {
    "insurance_active": true,
    "risk_score": 10,
    "vip_customer": false,
    "claim_amount": 100
  }
}
```

***

## Example Response

```json theme={null}
{
  "decision": {
    "status": "decided",
    "outcome": {
      "action": "approve",
      "requires_override": false,
      "reason": "standard_approval"
    },
    "rule_id": "standard-approval",
    "source": "rule_match"
  }
}
```

***

## Response Fields

### decision.status

Current decision state.

```json theme={null}
{
  "status": "decided"
}
```

***

### decision.outcome.action

Policy action.

```json theme={null}
{
  "action": "approve"
}
```

Possible values:

```text theme={null}
approve
reject
escalate
```

***

### decision.outcome.requires\_override

Whether override authority is required.

```json theme={null}
{
  "requires_override": false
}
```

***

### decision.outcome.reason

Reason returned by policy.

```json theme={null}
{
  "reason": "standard_approval"
}
```

***

### decision.rule\_id

Rule that produced the outcome.

```json theme={null}
{
  "rule_id": "standard-approval"
}
```

***

### decision.ruleTrace

Optional rule evaluation trace.

```json theme={null}
{
  "ruleTrace": [
    {
      "ruleId": "standard-approval",
      "matched": true
    }
  ]
}
```

Useful for debugging and policy validation.

***

## Example Scenarios

### Standard Approval

Input:

```json theme={null}
{
  "insurance_active": true,
  "risk_score": 10,
  "claim_amount": 100
}
```

Output:

```json theme={null}
{
  "action": "approve"
}
```

***

### Override Required

Input:

```json theme={null}
{
  "insurance_active": false,
  "risk_score": 75,
  "claim_amount": 100
}
```

Output:

```json theme={null}
{
  "action": "reject",
  "requires_override": true
}
```

***

## No Attestation

Simulation does not create:

```text theme={null}
Attestation
Signature
Execution Evidence
Integrity Proof
Verification Record
```

If you need a signed authorization decision, use:

```http theme={null}
POST /evaluate
```

***

## Error Responses

### 400 Bad Request

```json theme={null}
{
  "error": "Invalid request"
}
```

***

### 401 Unauthorized

```json theme={null}
{
  "error": "Unauthorized"
}
```

***

### 404 Policy Not Found

```json theme={null}
{
  "error": "Policy not found"
}
```

***

### 422 Validation Failed

```json theme={null}
{
  "error": "Signal validation failed"
}
```

***

### 500 Internal Error

```json theme={null}
{
  "error": "Simulation failed"
}
```

***

## Example — curl

```bash theme={null}
curl -X POST https://your-runtime/simulate \
  -H "Authorization: Bearer $PARMANA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "policyId":"claims-approval",
    "policyVersion":"1.0.0",
    "signals":{
      "insurance_active":true,
      "risk_score":10,
      "vip_customer":false,
      "claim_amount":100
    }
  }'
```

***

## How Simulation Fits Into Parmana

```text theme={null}
Policy Development
        ↓
Simulation
        ↓
Policy Validation
        ↓
Production Evaluation
        ↓
Attestation
```

Simulation is a developer tool.

Production authorization should use `/evaluate`.
