---
title: "Compare Policy Versions"
method: GET
path: "/policies/compare"
tags: ["Policies"]
---

# Compare Policy Versions

`GET /policies/compare`

## Request

- Base URL: `https://api.vibebrowser.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.vibebrowser.app/policies/compare`
- Auth: one of:
  - API key in header `x-litellm-api-key`
  - API key in header `x-litellm-api-key`
  - API key in header `x-litellm-api-key`
  - API key in header `x-litellm-api-key`
  - API key in header `x-litellm-api-key`
  - API key in header `x-litellm-api-key`

Compare two policy versions. Query params: version_a, version_b (policy version IDs).

## Query parameters

- `version_a` string, required
- `version_b` string, required

## Response `200`

Successful Response

- PolicyVersionCompareResponse: Response for comparing two policy versions.
  - `version_a` PolicyDBResponse, required: Response for a policy from the database.
    - `policy_id` string, required: Unique ID of the policy.
    - `policy_name` string, required: Name of the policy.
    - `version_number` integer: Version number of this policy.
    - `version_status` string: One of: draft, published, production.
    - `parent_version_id` string, nullable: Policy ID this version was cloned from.
    - `is_latest` boolean: True if this is the latest version by version_number.
    - `published_at` string, date-time, nullable: When this version was published.
    - `production_at` string, date-time, nullable: When this version was promoted to production.
    - `inherit` string, nullable: Parent policy name.
    - `description` string, nullable: Policy description.
    - `guardrails_add` string[]: Guardrails to add.
    - `guardrails_remove` string[]: Guardrails to remove.
    - `condition` object, nullable: Policy condition.
    - `pipeline` object, nullable: Optional guardrail pipeline.
    - `created_at` string, date-time, nullable: When the policy was created.
    - `updated_at` string, date-time, nullable: When the policy was last updated.
    - `created_by` string, nullable: Who created the policy.
    - `updated_by` string, nullable: Who last updated the policy.
  - `version_b` PolicyDBResponse, required: Response for a policy from the database.
    - `policy_id` string, required: Unique ID of the policy.
    - `policy_name` string, required: Name of the policy.
    - `version_number` integer: Version number of this policy.
    - `version_status` string: One of: draft, published, production.
    - `parent_version_id` string, nullable: Policy ID this version was cloned from.
    - `is_latest` boolean: True if this is the latest version by version_number.
    - `published_at` string, date-time, nullable: When this version was published.
    - `production_at` string, date-time, nullable: When this version was promoted to production.
    - `inherit` string, nullable: Parent policy name.
    - `description` string, nullable: Policy description.
    - `guardrails_add` string[]: Guardrails to add.
    - `guardrails_remove` string[]: Guardrails to remove.
    - `condition` object, nullable: Policy condition.
    - `pipeline` object, nullable: Optional guardrail pipeline.
    - `created_at` string, date-time, nullable: When the policy was created.
    - `updated_at` string, date-time, nullable: When the policy was last updated.
    - `created_by` string, nullable: Who created the policy.
    - `updated_by` string, nullable: Who last updated the policy.
  - `field_diffs` object: Field name -> {version_a: val, version_b: val} for differing fields.

## Other responses

- `422`: Validation Error

---

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