---
title: "Resolve Policies For Context"
method: POST
path: "/policies/resolve"
tags: ["Policies"]
---

# Resolve Policies For Context

`POST /policies/resolve`

Resolve which policies and guardrails apply for a given context.

Use this endpoint to debug "what guardrails would apply to a request
with this team/key/model/tags combination?"

Example Request:
```bash
curl -X POST "http://localhost:4000/policies/resolve" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "tags": ["healthcare"],
        "model": "gpt-4"
    }'
```

## Query parameters

- `force_sync` boolean — Force a DB sync before resolving. Default uses in-memory cache.

## Request body

- PolicyResolveRequest — Request body for resolving effective policies/guardrails for a context.
  - `team_alias` string, nullable — Team alias to resolve for.
  - `key_alias` string, nullable — Key alias to resolve for.
  - `model` string, nullable — Model name to resolve for.
  - `tags` string[], nullable — Tags to resolve for.

## Response `200`

Successful Response

- PolicyResolveResponse — Response for resolving effective policies/guardrails for a context.
  - `effective_guardrails` string[] — Final list of guardrails that would be applied.
  - `matched_policies` PolicyMatchDetail[] — Details about each matched policy and why it matched.
    - `policy_name` string, required — Name of the matched policy.
    - `matched_via` string, required — How the policy was matched (e.g., 'tag:healthcare', 'team:health-team', 'scope:*').
    - `guardrails_added` string[] — Guardrails this policy contributes.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sea-lion/apis/litellm-api.md) · [All operations](https://skmtc.net/sea-lion/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sea-lion/litellm-api/revisions/79928a3d37d3/schema)
