---
title: "Generate policy recommendation"
method: POST
path: "/teams/recommend-policy"
tags: ["Intelligence"]
---

# Generate policy recommendation

`POST /teams/recommend-policy`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/teams/recommend-policy`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`

Generate a recommended CLPI policy for a team based on current agent capabilities, alignment cards, historical violations, and known fault lines. The recommendation aims to close coverage gaps while minimizing disruption to existing workflows. **Authorization:** the caller must be a member (any role) of the org that owns the team behind the forecast. A forecast for a team in another org returns `404`, identical to a nonexistent id.

## Request body

- object
  - `forecast_id` string, required: Identifier of the risk forecast to base the recommendation on. Required.
  - `constraints` object: Optional recommendation constraints.
    - `enforcement_mode` 'warn' | 'enforce'
    - `allow_unmapped_tools` boolean
    - `preserve_existing_policy` boolean

## Response `200`

Policy recommendation

- object
  - `recommended_policy` Policy: A complete CLPI policy document defining capability mappings, forbidden tools, escalation triggers, and enforcement defaults.
    - `meta` PolicyMeta: Metadata for a CLPI policy including schema version, name, description, and scope.
      - `schema_version` string: Semantic version of the policy schema (e.g. '1.0.0')
      - `name` string: Human-readable name of the policy
      - `description` string: Detailed description of the policy's purpose
      - `scope` 'agent' | 'org' | 'global': Scope at which the policy applies
    - `capability_mappings` object: Map of capability names to their definitions
    - `forbidden` ForbiddenRule[]: List of forbidden tool rules
      - `pattern` string, required: Glob or regex pattern matching tool identifiers to forbid
      - `reason` string, required: Human-readable reason why these tools are forbidden
      - `severity` 'low' | 'medium' | 'high' | 'critical': Severity level when a forbidden tool is invoked
    - `escalation_triggers` EscalationTrigger[]: List of escalation trigger definitions
      - `condition` string, required: Expression or rule describing when this trigger fires (e.g. 'violation_count > 3')
      - `action` 'notify' | 'pause' | 'block' | 'require_approval', required: Action to take when the condition is met
      - `reason` string: Human-readable explanation of why this escalation exists
    - `defaults` PolicyDefaults: Default enforcement behavior for tools and situations not explicitly covered by the policy.
      - `unmapped_tool_action` 'allow' | 'warn' | 'block' | 'escalate': Action to take when a tool is not mapped to any capability
      - `unmapped_severity` 'low' | 'medium' | 'high' | 'critical': Severity level assigned to unmapped tool invocations
      - `fail_open` boolean: If true, allow actions when the policy engine is unavailable. If false, block by default.
      - `enforcement_mode` 'observe' | 'enforce' | 'nudge': Default enforcement mode for the policy
      - `grace_period_hours` integer: Number of hours to allow violations before enforcement kicks in (for new policy rollouts)
  - `rationale` object[]
    - `field` string
    - `reason` string
    - `confidence` number
  - `expected_coverage` number
  - `fault_lines_addressed` integer

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Cross-origin write refused (`cross_origin_rejected`). A state-changing request that carries the browser session cookie must come from a first-party origin (`Origin`, or failing that `Referer`) and must not send a form-style body (text/plain, urlencoded, multipart) the operation does not declare. Bearer and API-key callers are never subject to this check.
- `404`: Resource not found
- `409`: Resource conflict — the request cannot proceed because of a current state conflict (e.g., resource already exists, version mismatch, in-flight idempotency key with a different body).
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
