Skip to main content
Policies allow you to create versioned, structured rulesets that agents use for document processing, compliance checking, and classification tasks. Instead of embedding rules directly in agent prompts, policies provide a centralized way to manage guidelines, instructions, and classification dispositions.

Use Cases

  • Compliance checking: Define rules and red/green flags for reviewing documents against regulatory requirements
  • Document classification: Create disposition categories for agents to classify documents into
  • Structured extraction: Provide hierarchical guidelines that agents follow when extracting information
  • Audit workflows: Maintain versioned policies for traceability and rollback capabilities

How Policies Work

  1. Create a policy at the organization level with a name and description
  2. Add versions to the policy, each containing structured content (guidelines, instructions, dispositions)
  3. Link the policy to one or more agents via the agent’s engine configuration
  4. Run agent jobs - agents apply the policy’s current version when processing documents
  5. Update policies by creating new versions without breaking existing agent configurations

Policy Versioning

Policies use a versioning model similar to agents:
  • Each policy has multiple versions containing the actual content
  • One version is marked as the current version
  • Agents reference a specific policy version via policy_version_id
  • Creating a new version automatically sets it as current
  • You can switch back to previous versions at any time

Policy Content Structure

Each policy version contains structured JSON content with four optional sections:

Guidelines

A hierarchical structure for organizing rules:
{
  "guidelines": {
    "categories": [
      {
        "title": "Document Verification",
        "description": "Rules for verifying document authenticity",
        "rules": [
          {
            "title": "Check signatures",
            "description": "Verify all required signatures are present",
            "flag": "RED_FLAG",
            "sub_rules": [
              {
                "title": "Authorized signatories",
                "description": "Signatures must match authorized personnel list"
              }
            ]
          }
        ]
      }
    ]
  }
}
FieldDescription
categoriesTop-level groupings of related rules
rulesIndividual rules within a category
sub_rulesNested rules for additional detail
flagOptional GREEN_FLAG or RED_FLAG indicator

Instructions

Free-form text instructions for the agent:
{
  "instructions": "Review all documents for compliance with company policy. Flag any discrepancies and provide detailed reasoning for each decision."
}

Dispositions

Classification options for agent outputs:
{
  "dispositions": {
    "classifications": [
      {
        "name": "Approved",
        "description": "Document meets all requirements",
        "prompt": "Select this when all compliance checks pass"
      },
      {
        "name": "Rejected",
        "description": "Document fails one or more requirements",
        "prompt": "Select this when any critical rule is violated"
      },
      {
        "name": "Needs Review",
        "description": "Document requires manual review",
        "prompt": "Select this for edge cases or unclear situations"
      }
    ]
  }
}

Summary Template

A Handlebars-style template for generating structured summaries:
{
  "summary_template": {
    "template": "## Review Summary\n\n**Decision**: {{disposition}}\n\n**Findings**:\n{{#each findings}}\n- {{this}}\n{{/each}}"
  }
}

Linking Policies to Agents

Policies are linked to agents through the agent’s engine configuration. When creating or updating an agent version, specify the policy_version_id to use:
{
  "engine_config": {
    "policy_version_id": "123e4567-e89b-12d3-a456-426614174000"
  }
}
Policies cannot be deleted while they are in use by any agent. You must first unlink all agents before deleting a policy.

API Reference