Skip to main content
The Policies Service gives you programmatic control over security, access, and governance policies in the Kubiya platform. Policies define what actions agents, users, or teams can perform on resources, enabling you to enforce fine-grained authorization, compliance, and operational best practices. By managing policies, you can ensure that only the right entities have access to sensitive operations, automate approvals, and maintain a secure environment as your organization grows.
For conceptual information about policies and how they’re used in the platform, see Policies Core Concepts.

Overview

The Policies Service enables you to:
  • List policies with pagination support
  • Get policy details including rules, conditions, and enforcement settings
  • Create custom policies for access control and governance
  • Update policy configurations for existing policies
  • Delete policies when no longer needed
  • Evaluate policies for specific entities and actions
  • Check authorization before performing actions

Quick Start

List Policies

List all policies with pagination support.
The Policies Service uses page-based pagination (page 1, 2, 3…) instead of skip/limit pagination used by other services.

Basic Listing

Paginated Listing

List All Policies

Filter Policies by Type

Get Policy Details

Retrieve detailed information about a specific policy.

By Policy ID

Extract Policy Information

Find Policy by Name

Create Policy

Create a new security or access control policy.

Basic RBAC Policy

Resource-Specific Policy

Approval Workflow Policy

Time-Based Policy

Update Policy

Update an existing policy configuration.

Basic Update

Add Rules to Policy

Enable/Disable Policy

Update Policy Priority

Delete Policy

Delete a policy.
Deleting a policy affects authorization checks for all entities. Ensure the policy is no longer needed before deletion.

Delete with Safety Check

Evaluate Policy

Evaluate a policy for a specific entity and action.

Basic Evaluation

Evaluate with Resource Context

Evaluate Multiple Actions

Check Authorization

Check if an entity is authorized for a specific action on a resource.

Basic Authorization Check

Pre-Action Authorization

Bulk Authorization Check

Practical Examples

1. Policy Audit System

2. Policy Compliance Checker

3. Permission Matrix Generator

4. Policy Template Library

Error Handling

When working with policies, you may encounter errors such as requesting a non-existent policy, failing evaluation, or authorization checks. These examples show how to handle such errors gracefully and provide fallback options to keep your workflows secure and robust.

Best Practices

1. Use Priority for Policy Ordering

2. Always Check Authorization Before Actions

3. Use Descriptive Policy Names

4. Test Policies Before Enabling

API Reference

Methods

Policy Object Structure

Evaluation Result Object Structure

Authorization Result Object Structure

Next Steps

Agents Service

Create and manage agents

Skills Service

Manage skills and capabilities

Best Practices

SDK best practices guide