---
title: "Update Rule"
method: PATCH
path: "/v1/rules/{rule_id}"
tags: ["Agent Environment", "policy-rules"]
---

# Update Rule

`PATCH /v1/rules/{rule_id}`

Update a rule.

## Path parameters

- `rule_id` string, uuid, required

## Request body

- PolicyRuleUpdate — Request model for updating a policy rule. All fields are optional.
  - `rule_id` string, nullable
  - `rule_type` 'permission' | 'prohibition' | 'obligation' | 'recommendation' — Type of policy rule (ODRL-inspired).
  - `action` string, nullable
  - `target` string, nullable
  - `assignee` string, nullable
  - `constraints` union
    - RuleConstraint[]
      - `condition_type` string, required
      - `field` string, required
      - `operator` string, required
      - `value` union, required
        - string
        - integer
        - number
        - boolean
        - string[]
    - object[]
  - `conditions` object[], nullable
  - `constraint_logic` string, nullable
  - `consequence` union
    - RuleConsequence — Consequence when rule is triggered.
      - `action` string
      - `severity` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity level for rule consequences.
      - `message` string, nullable
    - object
  - `natural_language` string, nullable
  - `category` 'privacy' | 'ethics' | 'security' | 'compliance' | 'operational' | 'brand' | 'custom' — Category of policy document.
  - `status` 'draft' | 'approved' | 'rejected' | 'modified' — Review status of a policy rule.
  - `tags` string[], nullable

## Response `200`

Successful Response

- PolicyRule — Domain model for Policy Rule. This follows an ODRL-inspired schema: - rule_type: permission/prohibition/obligation/recommendation - action: what action this rule governs - target: what asset/data is affected - assignee: who must comply (usually "agent") - constraints: conditions under which rule applies - consequence: what happens when rule is violated
  - `id` string, uuid, required
  - `policy_id` string, uuid, required
  - `rule_id` string, required
  - `rule_type` 'permission' | 'prohibition' | 'obligation' | 'recommendation', required — Type of policy rule (ODRL-inspired).
  - `action` string, required
  - `target` string, nullable
  - `assignee` string, nullable
  - `constraints` union
    - RuleConstraint[]
      - `condition_type` string, required
      - `field` string, required
      - `operator` string, required
      - `value` union, required
        - string
        - integer
        - number
        - boolean
        - string[]
    - object[]
  - `constraint_logic` string
  - `consequence` union, required
    - RuleConsequence — Consequence when rule is triggered.
      - `action` string
      - `severity` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity level for rule consequences.
      - `message` string, nullable
    - object
  - `natural_language` string, required
  - `provenance` union
    - RuleProvenance — Provenance information for rule extraction.
      - `extracted_by` 'llm' | 'manual'
      - `model_used` string, nullable
      - `confidence_score` number, nullable
      - `source_location` SourceLocation — Location in source document where rule was extracted from.
        - `section` string, nullable
        - `paragraph` integer, nullable
        - `char_start` integer, nullable
        - `char_end` integer, nullable
        - `source_text` string, nullable
    - object
  - `category` 'privacy' | 'ethics' | 'security' | 'compliance' | 'operational' | 'brand' | 'custom' — Category of policy document.
  - `tags` string[], nullable
  - `status` 'draft' | 'approved' | 'rejected' | 'modified' — Review status of a policy rule.
  - `reviewed_by` string, uuid, nullable
  - `reviewed_at` integer, nullable
  - `review_notes` string, nullable
  - `created_at` integer, required
  - `updated_at` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/vijilai/apis/vijil-console-api-combined.md) · [All operations](https://skmtc.net/vijilai/apis/vijil-console-api-combined/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vijilai/vijil-console-api-combined/versions/a8b2ee2b2d06/schema)
