Open Policy Agent · Capability

Policy API

Policy API. 4 operations. Lead operation: List Policies. Self-contained Naftiko capability covering one Open Policy Agent business surface.

Run with Naftiko Open Policy AgentPolicy API

What You Can Do

GET
Get — List Policies
/v1/v1/policies
GET
Get — Get a Policy
/v1/v1/policies/{id}
PUT
Put — Create or Update a Policy
/v1/v1/policies/{id}
DELETE
Delete — Delete a Policy
/v1/v1/policies/{id}

MCP Tools

list-policies

List Policies

read-only idempotent
get-policy

Get a Policy

read-only idempotent
create-update-policy

Create or Update a Policy

idempotent
delete-policy

Delete a Policy

idempotent

Capability Spec

policy.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Policy API
  description: 'Policy API. 4 operations. Lead operation: List Policies. Self-contained Naftiko capability covering one Open
    Policy Agent business surface.'
  tags:
  - Open Policy Agent
  - Policy API
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    OPEN_POLICY_AGENT_API_KEY: OPEN_POLICY_AGENT_API_KEY
capability:
  consumes:
  - type: http
    namespace: policy
    baseUri: ''
    description: Policy API business capability. Self-contained, no shared references.
    resources:
    - name: v1-policies
      path: /v1/policies
      operations:
      - name: get
        method: GET
        description: List Policies
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: v1-policies-id
      path: /v1/policies/{id}
      operations:
      - name: get
        method: GET
        description: Get a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: Policy module identifier
          required: true
        - name: pretty
          in: query
          type: boolean
          description: Format response for human readability
      - name: put
        method: PUT
        description: Create or Update a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: Policy module identifier
          required: true
        - name: pretty
          in: query
          type: boolean
          description: Format response for human readability
        - name: metrics
          in: query
          type: boolean
          description: Return compiler performance metrics
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: delete
        method: DELETE
        description: Delete a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: Policy module identifier
          required: true
        - name: pretty
          in: query
          type: boolean
          description: Format response for human readability
        - name: metrics
          in: query
          type: boolean
          description: Return compiler performance metrics
  exposes:
  - type: rest
    namespace: policy-rest
    port: 8080
    description: REST adapter for Policy API. One Spectral-compliant resource per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/v1/policies
      name: v1-policies
      description: REST surface for v1-policies.
      operations:
      - method: GET
        name: get
        description: List Policies
        call: policy.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/policies/{id}
      name: v1-policies-id
      description: REST surface for v1-policies-id.
      operations:
      - method: GET
        name: get
        description: Get a Policy
        call: policy.get
        with:
          id: rest.id
          pretty: rest.pretty
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Create or Update a Policy
        call: policy.put
        with:
          id: rest.id
          pretty: rest.pretty
          metrics: rest.metrics
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: Delete a Policy
        call: policy.delete
        with:
          id: rest.id
          pretty: rest.pretty
          metrics: rest.metrics
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: policy-mcp
    port: 9090
    transport: http
    description: MCP adapter for Policy API. One tool per consumed operation, routed inline through this capability's consumes
      block.
    tools:
    - name: list-policies
      description: List Policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: policy.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-policy
      description: Get a Policy
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: policy.get
      with:
        id: tools.id
        pretty: tools.pretty
      outputParameters:
      - type: object
        mapping: $.
    - name: create-update-policy
      description: Create or Update a Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: policy.put
      with:
        id: tools.id
        pretty: tools.pretty
        metrics: tools.metrics
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-policy
      description: Delete a Policy
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: policy.delete
      with:
        id: tools.id
        pretty: tools.pretty
        metrics: tools.metrics
      outputParameters:
      - type: object
        mapping: $.