Confident AI Admin SDK
Use this skill to manage a Confident AI account programmatically with the
Admin SDK — the confidentai package, available for both Python and
TypeScript. The work is account and project administration: organizations,
projects, members and invitations, RBAC (permissions, policies, roles),
governance policies, and API keys.
This skill stops at administration. Sending traces and running evaluations
against a project is a different job with a different key — see the deepeval,
deepeval-tracing, and deepeval-otel skills.
Scope: Account Administration Only
Use the Admin SDK for administrative workflows that would otherwise be done by
hand in the platform UI — project provisioning, member onboarding, role
synchronization, and API key rotation. Every operation is scoped to either the
organization (account-wide resources) or a single project
(project-scoped resources).
Do not reach for this skill to instrument an app or score outputs. Tracing and
evals authenticate with a project key (CONFIDENT_API_KEY); administration
authenticates with an Organization API Key (CONFIDENT_ORG_API_KEY).
When to Use vs the Eval / Tracing Skills
- This skill (
confident-client) — administer the account: create and
rename the organization, CRUD projects, invite and manage members, define
RBAC, and provision or rotate API keys. Requires an Organization API Key.
deepeval skill — build pytest eval suites: datasets, metrics, traced
evals, deepeval test run, iteration. Requires a project key.
deepeval-tracing skill — instrument an app with the DeepEval SDK
(@observe, integrations). Requires a project key.
deepeval-otel skill — export raw OpenTelemetry / OTLP traces to
Confident AI. Requires a project key.
Prerequisites
- The Admin SDK installed:
pip install confidentai (Python) or
npm install confidentai (TypeScript).
- An Organization API Key (e.g.
confident_us_org_...), read by default
from the CONFIDENT_ORG_API_KEY environment variable. This is separate from
the project-scoped CONFIDENT_API_KEY used for tracing and evals, so both can
be configured at once. Retrieve the org key from the Confident AI settings
under organization-level authentication.
Language Detection
Each reference file contains both Python and TypeScript examples. Before writing
code, determine which language the user is working in, then use the matching
code block (```python or ```typescript) within the
reference.
- Honor an explicit request first — if the user names a language or shows a
snippet, use that regardless of the project files.
- Otherwise infer from the project — but only for a clean single-language
project (markers from one ecosystem and none from the other):
- Python markers:
*.py, pyproject.toml, requirements.txt, setup.py, Pipfile, a .venv/venv
- TypeScript/Node markers:
*.ts, *.tsx, package.json, tsconfig.json, node_modules (JavaScript-only counts as TypeScript — same confidentai package)
- If markers from BOTH ecosystems are present — even if one side has more
code — or the project is empty/unclear, it is AMBIGUOUS: STOP and ask which
language before writing any code. Do not rationalize a "dominant" or
"obvious" language from which files happen to have more content (e.g. a
populated
ts/ next to a bare .venv is still ambiguous). Fall back to
Python (never TypeScript) only after asking and getting no answer, and say
you're defaulting.
Within each reference, the code block for the target language is authoritative
for exact method names, argument shapes (keyword arguments vs an options
object), and casing (snake_case vs camelCase). Do not guess a binding from the
other language's examples.
Workflow
- Confirm the task is administration (managing orgs, projects, members, roles,
or keys). If the user instead wants to send traces or run evals, stop and use
the
deepeval / deepeval-tracing / deepeval-otel skills.
- Determine the target language — Python or TypeScript — using the
Language Detection section above, then read
references/<topic>.md and
use the code blocks for that language.
- Configure the client with an Organization API Key. Read
references/quickstart.md.
- Pick the right scope: organization-wide (
client.organization()) vs a single
project (client.project(project_id)). Read references/introduction.md for
scope and capabilities.
- Read the exact reference for the resource being managed
(organization, projects, members and invitations, RBAC, governance policies,
or API keys) before writing code, and follow its examples.
- For RBAC, compose in order: list
permissions, bundle them into policies,
bundle policies into roles, then assign roles to members. Read
references/roles-policies-permissions.md.
- When creating an API key (or a project, which mints its first key), capture
the full secret
value immediately — it is shown only once. Read
references/api-keys.md.
Core Principles
- Administration uses an Organization API Key
(
CONFIDENT_ORG_API_KEY), never a project key. Keep it out of source
control and logs.
- Choose scope deliberately: organization-scoped calls affect the whole
account; project-scoped calls (
client.project(id)) affect one project.
- An API key's full secret
value is returned only at creation (creating a
project also mints its first project key). Store it securely then; later
reads are masked.
- RBAC composes in one direction: permissions → policies → roles → members.
Permissions are predefined and read-only; you can only list them.
- A user must be an organization member before being added to a project.
Invitations create membership when accepted.
- Destructive operations are irreversible — deleting a project permanently
removes its datasets, prompts, traces, and evaluations; deleting a key
immediately revokes it. Prefer disabling a key (set
valid to false) over
deleting when you only need to revoke temporarily.
- Never hardcode secrets or raw sensitive data; prefer environment variables
for keys.
- Governance policies are organization-scoped only and read-only through
the SDK — list them and assign/unassign them to projects, but do not expect
create/update/delete. (Python only: every method also has an async
a_*
variant.)
- Clarify before mutating. For create/update calls, confirm the required
inputs and ask about consequential optional ones the user hasn't specified
rather than silently omitting them or guessing. In particular: whether a new
project should have an owner (
email), and which role (role_id) to
grant when inviting members or adding them to a project. Ask first, then act.
References
Each topic has one reference file containing both Python and TypeScript
examples; use the code block matching the target language.
| Topic |
File |
| Install, configure the Organization API Key, first call |
references/quickstart.md |
| Read and rename the organization |
references/organization.md |
| Create, read, update, delete projects |
references/projects.md |
| Members, invitations, and role assignment |
references/members-and-invitations.md |
| RBAC: permissions, policies, and roles |
references/roles-policies-permissions.md |
| Provision, rotate, enable/disable, and delete API keys |
references/api-keys.md |
| Governance policies: list and assign/unassign to projects (org-only) |
references/governance.md |
| Admin SDK overview, org vs project scope, and key capabilities |
references/introduction.md |
| Background: why observability matters for AI products |
references/ai-pm-observability.md |
1---2name: confident-client3description: Manage a Confident AI account programmatically with the Admin SDK (the `confidentai` package for Python and TypeScript). TRIGGER when the user wants to create, read, update, or delete organizations, projects, members, invitations, roles, policies, permissions, governance policies, or API keys on Confident AI; provision or rotate organization- and project-scoped API keys; onboard or offboard team members; set up RBAC (permissions → policies → roles → members); assign governance policies to projects; or automate project provisioning (project-per-agent, project-per-environment, project-per-customer). All administrative operations require an Organization API Key (`CONFIDENT_ORG_API_KEY`). DO NOT TRIGGER for sending traces or running evaluations against a project (that uses a project key `CONFIDENT_API_KEY` — see the `deepeval`, `deepeval-tracing`, and `deepeval-otel` skills); this skill is account and project administration only, not tracing or evals.4license: Apache-2.05---67# Confident AI Admin SDK89Use this skill to manage a **Confident AI account programmatically** with the10Admin SDK — the `confidentai` package, available for both Python and11TypeScript. The work is account and project administration: organizations,12projects, members and invitations, RBAC (permissions, policies, roles),13governance policies, and API keys.1415This skill stops at administration. Sending traces and running evaluations16against a project is a different job with a different key — see the `deepeval`,17`deepeval-tracing`, and `deepeval-otel` skills.1819## Scope: Account Administration Only2021Use the Admin SDK for administrative workflows that would otherwise be done by22hand in the platform UI — project provisioning, member onboarding, role23synchronization, and API key rotation. Every operation is scoped to either the24**organization** (account-wide resources) or a single **project**25(project-scoped resources).2627Do not reach for this skill to instrument an app or score outputs. Tracing and28evals authenticate with a project key (`CONFIDENT_API_KEY`); administration29authenticates with an Organization API Key (`CONFIDENT_ORG_API_KEY`).3031## When to Use vs the Eval / Tracing Skills3233- **This skill (`confident-client`)** — administer the account: create and34 rename the organization, CRUD projects, invite and manage members, define35 RBAC, and provision or rotate API keys. Requires an **Organization API Key**.36- **`deepeval` skill** — build pytest eval suites: datasets, metrics, traced37 evals, `deepeval test run`, iteration. Requires a **project key**.38- **`deepeval-tracing` skill** — instrument an app with the DeepEval SDK39 (`@observe`, integrations). Requires a **project key**.40- **`deepeval-otel` skill** — export raw OpenTelemetry / OTLP traces to41 Confident AI. Requires a **project key**.4243## Prerequisites4445- The Admin SDK installed: `pip install confidentai` (Python) or46 `npm install confidentai` (TypeScript).47- An **Organization API Key** (e.g. `confident_us_org_...`), read by default48 from the `CONFIDENT_ORG_API_KEY` environment variable. This is separate from49 the project-scoped `CONFIDENT_API_KEY` used for tracing and evals, so both can50 be configured at once. Retrieve the org key from the Confident AI settings51 under organization-level authentication.5253## Language Detection5455Each reference file contains both Python and TypeScript examples. Before writing56code, determine which language the user is working in, then use the matching57code block (```` ```python ```` or ```` ```typescript ````) within the58reference.59601. **Honor an explicit request first** — if the user names a language or shows a61 snippet, use that regardless of the project files.622. **Otherwise infer from the project — but only for a _clean single-language_63 project** (markers from one ecosystem and none from the other):64 - Python markers: `*.py`, `pyproject.toml`, `requirements.txt`, `setup.py`, `Pipfile`, a `.venv`/`venv`65 - TypeScript/Node markers: `*.ts`, `*.tsx`, `package.json`, `tsconfig.json`, `node_modules` (JavaScript-only counts as TypeScript — same `confidentai` package)663. **If markers from BOTH ecosystems are present — even if one side has more67 code — or the project is empty/unclear, it is AMBIGUOUS: STOP and ask which68 language before writing any code.** Do not rationalize a "dominant" or69 "obvious" language from which files happen to have more content (e.g. a70 populated `ts/` next to a bare `.venv` is still ambiguous). Fall back to71 **Python** (never TypeScript) only after asking and getting no answer, and say72 you're defaulting.7374Within each reference, the code block for the target language is authoritative75for exact method names, argument shapes (keyword arguments vs an options76object), and casing (snake_case vs camelCase). Do not guess a binding from the77other language's examples.7879## Workflow80811. Confirm the task is administration (managing orgs, projects, members, roles,82 or keys). If the user instead wants to send traces or run evals, stop and use83 the `deepeval` / `deepeval-tracing` / `deepeval-otel` skills.842. Determine the target language — **Python** or **TypeScript** — using the85 **Language Detection** section above, then read `references/<topic>.md` and86 use the code blocks for that language.873. Configure the client with an Organization API Key. Read88 `references/quickstart.md`.894. Pick the right scope: organization-wide (`client.organization()`) vs a single90 project (`client.project(project_id)`). Read `references/introduction.md` for91 scope and capabilities.925. Read the exact reference for the resource being managed93 (organization, projects, members and invitations, RBAC, governance policies,94 or API keys) before writing code, and follow its examples.956. For RBAC, compose in order: list `permissions`, bundle them into `policies`,96 bundle policies into `roles`, then assign roles to members. Read97 `references/roles-policies-permissions.md`.987. When creating an API key (or a project, which mints its first key), capture99 the full secret `value` immediately — it is shown only once. Read100 `references/api-keys.md`.101102## Core Principles1031041. Administration uses an **Organization API Key**105 (`CONFIDENT_ORG_API_KEY`), never a project key. Keep it out of source106 control and logs.1072. Choose scope deliberately: organization-scoped calls affect the whole108 account; project-scoped calls (`client.project(id)`) affect one project.1093. An API key's full secret `value` is returned **only at creation** (creating a110 project also mints its first project key). Store it securely then; later111 reads are masked.1124. RBAC composes in one direction: permissions → policies → roles → members.113 Permissions are predefined and read-only; you can only list them.1145. A user must be an **organization member** before being added to a project.115 Invitations create membership when accepted.1166. Destructive operations are irreversible — deleting a project permanently117 removes its datasets, prompts, traces, and evaluations; deleting a key118 immediately revokes it. Prefer disabling a key (set `valid` to false) over119 deleting when you only need to revoke temporarily.1207. Never hardcode secrets or raw sensitive data; prefer environment variables121 for keys.1228. Governance policies are **organization-scoped only** and read-only through123 the SDK — list them and assign/unassign them to projects, but do not expect124 create/update/delete. (Python only: every method also has an async `a_*`125 variant.)1269. **Clarify before mutating.** For create/update calls, confirm the required127 inputs and ask about consequential optional ones the user hasn't specified128 rather than silently omitting them or guessing. In particular: whether a new129 project should have an **owner** (`email`), and which **role** (`role_id`) to130 grant when inviting members or adding them to a project. Ask first, then act.131132## References133134Each topic has one reference file containing both Python and TypeScript135examples; use the code block matching the target language.136137| Topic | File |138| --- | --- |139| Install, configure the Organization API Key, first call | `references/quickstart.md` |140| Read and rename the organization | `references/organization.md` |141| Create, read, update, delete projects | `references/projects.md` |142| Members, invitations, and role assignment | `references/members-and-invitations.md` |143| RBAC: permissions, policies, and roles | `references/roles-policies-permissions.md` |144| Provision, rotate, enable/disable, and delete API keys | `references/api-keys.md` |145| Governance policies: list and assign/unassign to projects (org-only) | `references/governance.md` |146| Admin SDK overview, org vs project scope, and key capabilities | `references/introduction.md` |147| Background: why observability matters for AI products | `references/ai-pm-observability.md` |