Skip to content

AgentPolicy CRD

The AgentPolicy custom resource defines network-level access control rules for AI agents. It configures JWT claim extraction, tool access restrictions, and enforcement modes via Istio AuthorizationPolicy.

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy

Determines which agents this policy applies to.

FieldTypeRequiredDescription
agents[]stringNoList of AgentRuntime names. If empty, applies to all agents in the namespace.
spec:
selector:
agents:
- customer-service
- internal-assistant

Configures JWT claim extraction and header forwarding. Claims are extracted from the user’s JWT token and propagated as HTTP headers through the facade, runtime, and tool adapter pipeline.

FieldTypeRequiredDescription
forwardClaims[]ClaimMappingEntryNoList of claims to extract and forward.

Each ClaimMappingEntry has:

FieldTypeRequiredDescription
claimstringYesJWT claim name. Supports dot-notation for nested claims (e.g., org.team).
headerstringYesHeader name to propagate the value as. Must match pattern X-Omnia-Claim-[A-Za-z0-9-]+.
spec:
claimMapping:
forwardClaims:
- claim: team
header: X-Omnia-Claim-Team
- claim: org.region
header: X-Omnia-Claim-Region
- claim: customer_id
header: X-Omnia-Claim-Customer-Id

Defines tool allowlist or denylist rules. These are enforced at the Istio network level via generated AuthorizationPolicy resources.

FieldTypeRequiredDescription
modestringYesAccess control mode: allowlist or denylist.
rules[]ToolAccessRuleYesList of tool access rules (minimum 1).

Each ToolAccessRule has:

FieldTypeRequiredDescription
registrystringYesName of the ToolRegistry resource.
tools[]stringYesList of tool names within the registry (minimum 1).

Allowlist example — only permit specific tools:

spec:
toolAccess:
mode: allowlist
rules:
- registry: customer-tools
tools:
- lookup_order
- check_status
- registry: common-tools
tools:
- search_kb

Denylist example — block specific tools:

spec:
toolAccess:
mode: denylist
rules:
- registry: admin-tools
tools:
- delete_user
- reset_database

Controls how the policy is applied.

ValueDescription
enforce(Default) Policy violations block the request.
permissivePolicy violations are logged but the request is allowed through.

Defines behavior when policy evaluation encounters an error.

ValueDescription
deny(Default) Deny the request on evaluation failure.
allowAllow the request despite the evaluation error.
ValueDescription
ActivePolicy is valid and applied.
ErrorPolicy has a configuration error.

Integer count of AgentRuntime resources matched by the selector.

Standard Kubernetes conditions indicating the current state of the resource.

The most recent .metadata.generation observed by the controller.

When using kubectl get agentpolicies, the following columns are displayed:

ColumnSource
Mode.spec.mode
Phase.status.phase
Matched.status.matchedAgents
Age.metadata.creationTimestamp
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: customer-service-policy
namespace: production
spec:
selector:
agents:
- customer-service-agent
claimMapping:
forwardClaims:
- claim: team
header: X-Omnia-Claim-Team
- claim: customer_id
header: X-Omnia-Claim-Customer-Id
- claim: org.tier
header: X-Omnia-Claim-Tier
toolAccess:
mode: allowlist
rules:
- registry: customer-tools
tools:
- lookup_order
- check_status
- process_refund
- registry: common-tools
tools:
- search_kb
mode: enforce
onFailure: deny

Expected status after reconciliation:

status:
phase: Active
matchedAgents: 1
observedGeneration: 1
conditions:
- type: Ready
status: "True"
reason: PolicyApplied
message: "Istio AuthorizationPolicy created"