> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datris.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace the agent policy (admin)

> Admin-only, and never permitted from an agent-initiated request regardless of key capabilities. Unknown action keys, bad modes or malformed overrides are rejected with 400 naming the problem.



## OpenAPI

````yaml /openapi.yaml put /api/v1/policy
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.28.0
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/policy:
    put:
      tags:
        - Agent Policy
      summary: Replace the agent policy (admin)
      description: >-
        Admin-only, and never permitted from an agent-initiated request
        regardless of key capabilities. Unknown action keys, bad modes or
        malformed overrides are rejected with 400 naming the problem.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentPolicy'
      responses:
        '200':
          description: The saved policy (version incremented)
        '400':
          description: Validation error
        '403':
          description: Not an admin, or an agent-initiated request
        '404':
          description: USE_AGENT_POLICY is off
components:
  schemas:
    AgentPolicy:
      type: object
      properties:
        version:
          type: integer
          readOnly: true
        actions:
          type: object
          description: >-
            action key (resource:action[:sub] or resource:*) → auto | approve |
            deny; unset is auto
          additionalProperties:
            type: string
            enum:
              - auto
              - approve
              - deny
        overrides:
          type: object
          description: >-
            pipeline:<name> or tap:<name> → action map that may only tighten the
            default
          additionalProperties:
            type: object
            additionalProperties:
              type: string
              enum:
                - auto
                - approve
                - deny
        limits:
          type: object
          properties:
            pendingTtlHours:
              type: integer
              default: 24
            maxPendingPerActor:
              type: integer
              default: 50
        updatedAt:
          type: string
          readOnly: true
        updatedBy:
          type: string
          readOnly: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````