---
title: "Create new Agent Policy"
method: POST
path: "/policies/agent"
tags: ["policy"]
---

# Create new Agent Policy

`POST /policies/agent`

## Request body

- union
  - PolicyCreateReqSchemaJson
    - `name` string, required — A unique name label
    - `description` string — User description of this Policy
    - `tags` object, required — User defined key/values for organization and searching
    - `version` integer — Currente version of agent policy
    - `backend` string, required — Agent backend this policy is for. Cannot change once created.
    - `schema_version` string — Schema version which needs to match the schema defined by the backend which will use the policy.
    - `policy` object, required — Agent backend specific policy data in json format
      - `kind` string
      - `input` object
        - `tap` string
        - `input_type` string
        - `config` object
          - `host_spec` string
        - `filter` object
          - `bpf` string
      - `handlers` object
        - `modules` object
          - `handlers_label` object
            - `type` string
  - PolicyCreateReqSchemaYaml
    - `name` string, required — A unique name label
    - `description` string — User description of this Policy
    - `tags` object, required — User defined key/values for organization and searching
    - `backend` string, required — Agent backend this policy is for. Cannot change once created.
    - `schema_version` string — Schema version which needs to match the schema defined by the backend which will use the policy.
    - `policy_data` string, required — Agent backend specific policy data in yaml format
    - `format` string, required — Policy text format needed to specify when a policy is a yaml

## Response `201`

Policy object

- PolicyObjSchema
  - `id` string, uuid, required — Unique identifier (UUID)
  - `name` string — A unique name label
  - `description` string — User description of this Policy
  - `tags` object — User defined key/values for organization and searching
  - `backend` string — The policy backend to use. Cannot change once created.
  - `ts_created` string, date-time — Timestamp of creation
  - `version` integer — A monotonically increasing counter starting at 0 on creation and increasing with each policy update.
  - `policy` object — Agent backend specific policy data in json format
  - `format` string — Policy text format needed to specify when a policy was created in yaml format.
  - `policy_data` string — Agent backend specific policy data in yaml format

## Other responses

- `400` — Failed due to malformed JSON
- `401` — Missing or invalid access token provided.
- `409` — Entity already exist.
- `415` — Mising or invalid content type.
- `422` — Database can't process request.
- `500` — Unexpected server-side error occurred.

---

[API](https://skmtc.net/orb-community/apis/orb-policies.md) · [All operations](https://skmtc.net/orb-community/apis/orb-policies/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/orb-community/orb-policies/versions/d95ee7691efb/schema)
