Skip to content
ALTAIRA LABS
DocsBlog

Configure agent policies

This guide covers common operational tasks for configuring AgentPolicy resources. For the full field reference, see the AgentPolicy CRD Reference.

  • Istio installed in your cluster
  • At least one AgentRuntime deployed
  • If running Istio in ambient mode: a waypoint proxy enrolled for each agent Service you intend to enforce toolAccess on

Limit an agent to only specific tools by creating an allowlist:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: support-agent-tools
namespace: production
spec:
selector:
agents:
- support-agent
toolAccess:
mode: allowlist
rules:
- registry: customer-tools
tools:
- lookup_order
- check_status
- registry: knowledge-base
tools:
- search_articles

The agent can only call the three listed tools. All other tool calls are blocked at the Istio level.

If most tools should be accessible but a few must be restricted:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: restrict-dangerous-tools
namespace: production
spec:
selector:
agents:
- general-assistant
toolAccess:
mode: denylist
rules:
- registry: admin-tools
tools:
- delete_user
- drop_table
- reset_credentials

Omit the selector field or leave agents empty to match all agents in the namespace:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: namespace-wide-policy
namespace: production
spec:
toolAccess:
mode: denylist
rules:
- registry: admin-tools
tools:
- destructive_action

When rolling out a new policy, start in permissive mode to verify behavior without blocking traffic:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: new-restrictions
namespace: production
spec:
selector:
agents:
- customer-service
toolAccess:
mode: allowlist
rules:
- registry: customer-tools
tools:
- lookup_order
- check_status
mode: permissive # Log violations without blocking

Monitor your logs for policy decisions, then switch to enforce when confident:

spec:
mode: enforce

Check that your policy is active and matching agents:

Terminal window
kubectl get agentpolicies -n production

Expected output:

NAME MODE PHASE MATCHED AGE
support-agent-tools enforce Active 1 5m
restrict-dangerous-tools enforce Active 1 2m

For detailed status including conditions:

Terminal window
kubectl describe agentpolicy support-agent-tools -n production

Multiple AgentPolicies can apply to the same agent. Each policy is translated into its own Istio AuthorizationPolicy. Istio evaluates them independently — a request must pass all matching policies.

# Policy 1: Tool restrictions for a specific agent
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: tool-restrictions
namespace: production
spec:
selector:
agents: [customer-service]
toolAccess:
mode: allowlist
rules:
- registry: customer-tools
tools: [lookup_order, process_refund]
---
# Policy 2: Namespace-wide denylist (applies to all agents)
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentPolicy
metadata:
name: namespace-wide-denylist
namespace: production
spec:
toolAccess:
mode: denylist
rules:
- registry: admin-tools
tools: [delete_user]