Governance Policies

List governance policies and enroll projects into them in code.

Overview

AI governance policies are organization-scoped bundles of controls that gate how your projects ship. Policies and their controls are created and configured in the platform UI; the Admin SDK lets you enroll projects into a policy in code — ideal for CI/CD pipelines that provision one project per customer or per agent. Each project belongs to at most one policy.

All methods on this page require an Organization API Key. See the Quickstart to create a client. Governance policies live under the governance namespace on the organization client (client.organization().governance); there is no project-scoped equivalent.

List Policies

List every governance policy in your organization. Each policy includes its controls and a projectsCount.

1from confidentai import ConfidentAI
2
3client = ConfidentAI()
4
5org = client.organization()
6
7policies = org.governance.policies.list()

List a Policy’s Projects

Page through the projects currently enrolled in a policy.

1org = client.organization()
2
3projects = org.governance.policies.list_projects(
4 "a17c4e2d-9b3f-4a6c-8d1e-2f5a9c3b7e0d",
5 page=1,
6 page_size=25,
7)

Assign Projects

Assign one or more projects to a policy. Assignment is additive and partial: every project that exists is enrolled and returned in assignedProjectIds (projects on a different policy are moved over), while ids that don’t exist in your organization come back in notFoundProjectIds instead of failing the call. Re-assigning an already-enrolled project still counts it, so this is safe to run on every pipeline execution.

1org = client.organization()
2
3result = org.governance.policies.assign(
4 "a17c4e2d-9b3f-4a6c-8d1e-2f5a9c3b7e0d",
5 project_ids=["clq9z3x1k0001la08f7t3g5p2"],
6)
7print(result.assigned_project_ids) # ["clq9z3x1k0001la08f7t3g5p2"]
8print(result.not_found_project_ids) # []
9print(result.count) # 1

Unassign Projects

Remove projects from a policy (for example, when deprovisioning a customer). Removal is also partial: projects currently on the policy are removed and returned in unassignedProjectIds, while ids that aren’t on this policy (unknown, foreign, or on another policy) come back in skippedProjectIds.

1org = client.organization()
2
3result = org.governance.policies.unassign(
4 "a17c4e2d-9b3f-4a6c-8d1e-2f5a9c3b7e0d",
5 project_ids=["clq9z3x1k0001la08f7t3g5p2"],
6)
7print(result.unassigned_project_ids) # ["clq9z3x1k0001la08f7t3g5p2"]
8print(result.skipped_project_ids) # []
9print(result.count) # 1

Each request also returns the modified governancePolicy ({ id, name }). For async code, every method has an a_-prefixed counterpart (a_list, a_list_projects, a_assign, a_unassign).

Next Steps