---
title: "Add Classifier Rule From Template"
method: POST
path: "/api/v1/classifiers/{classifier_id}/rules/from_template"
tags: ["Classifier Templates"]
---

# Add Classifier Rule From Template

`POST /api/v1/classifiers/{classifier_id}/rules/from_template`

## Request

- Base URL: `https://example.conductor.one`
- URL: `https://example.conductor.one/api/v1/classifiers/{classifier_id}/rules/from_template`
- Auth: HTTP bearer and OAuth 2
  - Client credentials
  - Token URL: `/auth/v1/token`

Add inserts a template rule into a tenant-owned classifier at insert_index.
 It resolves only that rule's required tool gates and hooks, rewrites their
 references, assigns a new rule ID, and records the source template.
 Grant-policy parameters are validated only for the added rule.

## Path parameters

- `classifier_id` string, required: Classifier to splice the rule into.

## Request body

- C1ApiAiGovernanceV1AddClassifierRuleFromTemplateRequestInput: The AddClassifierRuleFromTemplateRequest message.
  - `insertIndex` integer: Position in the target cascade to insert before. Pass the current rule count to append. Values past the end append.
  - `params` object: Bind-time param values for the spliced rule's grant gates, keyed by TemplateParam.key (e.g. grant_policy_id).
  - `ruleIndex` integer: Which rule in the template to add; defaults to 0 (the first/only rule).
  - `templateId` string, required: Template to source the rule from.
  - `templateVersion` string: Optional; empty resolves the latest version.

## Response `200`

Successful response

- C1ApiAiGovernanceV1AddClassifierRuleFromTemplateResponse: The AddClassifierRuleFromTemplateResponse message.
  - `classifier` C1ApiAiGovernanceV1Classifier: Classifier is a named, reusable rule cascade.
    - `applicableType` 'CLASSIFIER_TYPE_UNSPECIFIED' | 'CLASSIFIER_TYPE_AGENT' | 'CLASSIFIER_TYPE_GATEWAY' | 'CLASSIFIER_TYPE_BOTH': BOTH means Agent and gateway. Shared rules use private_data, exfiltration, tool_name, bounded tool_input, and user_roles; untrusted_content and agent_id require AGENT applicability. Changing applicability revalidates retained rules and cannot invalidate existing concrete bindings. Replacing rules in the same update validates the merged definition before persistence.
    - `createdAt` string, date-time, nullable
    - `defaultDenyReason` string: The defaultDenyReason field.
    - `defaultOutcome` 'AGENT_CLASSIFIER_RULE_OUTCOME_UNSPECIFIED' | 'AGENT_CLASSIFIER_RULE_OUTCOME_ALLOWED' | 'AGENT_CLASSIFIER_RULE_OUTCOME_DENIED': The defaultOutcome field.
    - `deletedAt` string, date-time, nullable
    - `description` string: The description field.
    - `displayName` string, required: The displayName field.
    - `id` string: The id field.
    - `managedBy` 'MANAGED_BY_UNSPECIFIED' | 'MANAGED_BY_TENANT' | 'MANAGED_BY_SYSTEM': The managedBy field.
    - `rules` C1ApiAiGovernanceV1AgentClassifierRule[], nullable: The rules field.
      - `action` 'AGENT_CLASSIFIER_RULE_ACTION_UNSPECIFIED' | 'AGENT_CLASSIFIER_RULE_ACTION_EVALUATE_HOOKS' | 'AGENT_CLASSIFIER_RULE_ACTION_BLOCK': The action field.
      - `celCondition` string: Empty matches every tool call.
      - `denyReason` string: The denyReason field.
      - `description` string: The description field.
      - `displayName` string, required: The displayName field.
      - `id` string: Stable rule identifier. Leave empty on a rule being added; the server assigns one.
      - `mode` 'AGENT_CLASSIFIER_RULE_MODE_UNSPECIFIED' | 'AGENT_CLASSIFIER_RULE_MODE_ENFORCE' | 'AGENT_CLASSIFIER_RULE_MODE_OBSERVE' | 'AGENT_CLASSIFIER_RULE_MODE_DISABLED': The mode field.
      - `outcome` 'AGENT_CLASSIFIER_RULE_OUTCOME_UNSPECIFIED' | 'AGENT_CLASSIFIER_RULE_OUTCOME_ALLOWED' | 'AGENT_CLASSIFIER_RULE_OUTCOME_DENIED': The outcome field.
      - `postHookIds` string[], nullable: The postHookIds field.
      - `preHookIds` string[], nullable: The preHookIds field.
      - `preOutputHookIds` string[], nullable: Hook ids of event type HOOK_EVENT_TYPE_PRE_OUTPUT curated by this rule, evaluated against the assistant's outgoing response rather than a tool call. Parallel to pre_hook_ids/post_hook_ids.
      - `sourceTemplateId` string: Rule template this rule was composed from via AddClassifierRuleFromTemplate. Empty for hand-authored rules; drives the "from template / Custom" provenance chip. Cleared once the rule diverges from its template.
      - `systemManaged` boolean: system_managed is true for rules the platform inserts and manages (currently: the baseline fallback rule appended at the end of every policy's rule list). system-managed rules cannot be created, updated, or deleted through the admin API — the frontend renders them read-only. Persisted user rules always serialize with system_managed = false.
      - `toolGateIds` string[], nullable: The toolGateIds field.
    - `templateRef` C1ApiAiGovernanceV1TemplateRef: TemplateRef links an instantiated guardrail to the template it was stamped from, for an optional "update available" affordance.
      - `templateId` string: The templateId field.
      - `version` string: The version field.
    - `tenantId` string: The tenantId field.
    - `updatedAt` string, date-time, nullable

## Changes

- **2026-10-06** `918a4e749f56`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/conductorone/apis/c1-api/changes/api/v1/classifiers/:classifier_id/rules/from_template/post.md)

---

[API](https://skmtc.dev/conductorone/apis/c1-api.md) - [All operations](https://skmtc.dev/conductorone/apis/c1-api/llms.txt) - [OpenAPI document](https://skmtc.dev/conductorone/apis/c1-api/revisions/fe943bedf41b?raw)
