Auth and project scoping
The minimum authentication and project-scoping decisions a developer must get right before calling CALIBER programmatically.
This guide explains the minimum authentication and scoping decisions a developer must make before calling CALIBER programmatically.
At a glance
| Topic | Current contract |
|---|---|
| Base management prefix | /ajax-api/2.0/mlflow/caliber |
| Automation auth | Authorization: Bearer <token> |
| Project scoping | X-CALIBER-Project: <project_id> |
| Project access | Owner, editor, reviewer, or viewer membership; project responses report access_role and permissions |
| Browser-style writes | X-CALIBER-CSRF: <token> when the deployment enables CSRF (CALIBER_CSRF_ENABLED, off by default); then it applies to bearer-token writes too |
| Best Python entry point | caliber-sdk |
| Best HTTP entry point | REST API overview |
1. Choose the auth model
For automation and SDK usage, prefer Bearer-token authentication.
Use the browser/session path only when you are intentionally emulating the UI contract.
A personal access token can be bound to a single project when it is created (project_id on POST /auth/tokens, or client.auth.tokens.create(..., project_id=...)). A bound token that names another project, in X-CALIBER-Project or in the URL, gets a 403, and one that names no project acts in its bound project. Use a bound token for CI jobs that import a revision: the Workspace import routes refuse an unbound personal access token.
For the full auth conventions and envelope details, use:
2. Always decide project scope explicitly
Most meaningful calls need a project context. In HTTP, that means setting X-CALIBER-Project. In the SDK, that means constructing or selecting a client scope that sends that header consistently.
If a workflow works in one project but not another, project scoping is one of the first things to verify.
3. Understand project access
Project visibility and project authority are separate from the token's global scope. A token must first authenticate with a sufficient global scope, and the caller must also have an active membership in the selected project (or be the project owner). caliber.admin is not an implicit member of any project. The effective project permissions are returned on project responses as access_role and permissions.
| Role | Effective project permissions |
|---|---|
owner | every project action: read, update, manage members, archive, restore and transfer ownership, write runtime assets and evidence, publish, approve, execute, manage the source and environments, revisions and Change Requests (including accepting one), and the release actions (including approve, roll back and reconcile) |
editor | read, update the project, write runtime assets and evidence, publish, execute, request and apply releases, import and snapshot revisions, and create, update, review and comment on Change Requests |
reviewer | read, write evidence, execute, approve, comment on Change Requests, record a release quality signoff |
viewer | read |
The owner role is only as strong as the caller's own platform scopes: an owner who no longer holds both caliber.operator and caliber.approver is treated as an editor until that is restored.
Owners can manage membership with GET/POST /projects/{project_id}/members, PATCH /projects/{project_id}/members/{user_id}, and DELETE /projects/{project_id}/members/{user_id}. The project's primary owner is created as the initial member and cannot be changed or removed through the member routes (409; use ownership transfer). Removing another member makes that membership inactive. Granting the owner role needs the target to hold both caliber.operator and caliber.approver (409 otherwise).
The typed SDK exposes the same operations:
project = client.projects.get("PRJ-1")
if "project.manage_members" in project.permissions:
members = client.projects.list_members(project.project_id)
client.projects.add_member(project.project_id, "@bob", role="reviewer")
The member-management calls require the project owner role and the global caliber.operator scope. A valid bearer token without the required project role receives a permission error; a caller with no visibility of the project, a caliber.admin token included, receives a not-found response.
Calibration jobs and live versions follow the project
A calibration job belongs to the prompt, skill or workflow it refines, so it is visible to exactly the callers who can see that target, and acting on it needs a project role:
| Action | Project role needed |
|---|---|
| List or read a job, its targets, or its quality reviews | any member |
| Request changes on a candidate, or submit a quality review | owner, editor or reviewer |
| Apply a candidate, promote a prompt version, or roll a prompt back | owner or editor |
A caller who is not a member of the project receives a not-found response, even when their token carries the global caliber.operator scope and even when the request names the project in X-CALIBER-Project. A member whose role is too weak receives a permission error. caliber.admin can read every project's jobs but, like every other role-gated action, is not an implicit member, so applying or rolling back needs a real role in that project. Apply checks the caller's project role again inside its claim, so a grant revoked while the request is in flight is refused (403, reason_code apply_permission_revoked) and nothing is applied.
Skills, tools, workflows and knowledge bases follow the project
The same rule covers every other project-scoped family: a caller who is not a member of the project receives a not-found response, and a member whose role is too weak receives a permission error that names the role. What each role may do on a mutating route:
| Action | Project role needed |
|---|---|
| Create or change a skill, tool, workflow, workflow version or knowledge base; replace a tool's test cases; clear workflow session memory | owner or editor |
| Publish a workflow version, promote or roll back an alias, publish or unpublish a workflow service, mint or revoke a service token | owner or editor |
| Run a workflow or a tool, start a calibration, upload a file into a run | owner, editor or reviewer |
| Record a test run or a baseline for a skill or tool; create or change a benchmark report | owner, editor or reviewer |
| Approve or reject a pending production promotion, or a run waiting for approval | owner or reviewer |
| Read, list, render, preview, validate, or query | any member |
Creating a skill, tool, workflow or knowledge base is checked against the project named in X-CALIBER-Project. Registering, changing or archiving a tool, and changing or rolling back a skill, also need the global caliber.admin scope, which is checked first. Before this contract only the workflow, run and knowledge-base roots checked a project role, so a viewer could publish a workflow version, move a production alias, approve a pending production promotion, publish a workflow as a service and mint a bearer token for it, run a tool, replace its test cases, and queue a calibration. caliber/tests/test_extended_family_isolation.py sweeps every one of these routes as an outsider, a viewer, a reviewer and an editor.
What the alpha does not enforce
- Gate verdicts are not project-scoped.
GETandPOST /gate-verdicts/{artifact_type}/{version_key}key a verdict by a free-form string that names no artifact, so no project can be derived from it, and any operator can overwrite any verdict. The verdict is advisory: no Apply, promotion or release decision reads it, and the UI has no consumer for it.
- Traces are not project-scoped. The observability pages and the trace and metric routes are open to every signed-in user, so anyone who can sign in can read traces and their payloads.
- Apply has no second approver unless the two-person rule is on, which is off in the development default. With
CALIBER_APPLY_REQUIRE_DISTINCT_APPROVERunset orfalse, anowneroreditorreviews and applies in one step, even a job they requested, and a job with no recorded requester is applied. With ittrue, which the reference profile requires, the account that requested the job is refused (403,reason_codeapply_self_approval) and so is a job with no recorded requester (apply_creator_unknown). Either way the approval record created at Apply time is an audit and rollback anchor that names who applied. See Apply: refusal catalogue, audit and recovery. - CSRF protection is off by default.
CALIBER_CSRF_ENABLEDis false unless you set it, which assumes a loopback or trusted-network deployment. Enable it, with a signing secret, before exposing CALIBER more widely. See Alpha scope and limitations.
4. SDK path
If you are writing Python, use the SDK unless you specifically need the raw wire layer.
Recommended path:
- SDK guide
- SDK API reference
- CLI and async client for operator-style automation
5. Raw HTTP path
Use the REST API directly when:
- you are integrating from another language
- you need OpenAPI-driven tooling
- you are debugging request/response behavior
Start from:
6. Common failure modes
| Symptom | First thing to check |
|---|---|
| Request is authenticated but sees the wrong objects | X-CALIBER-Project or SDK project scope |
| Project is visible but a write/publish is refused | access_role, permissions, and the token's global scope |
| Member routes return 403 | only the project owner can manage membership |
| Project route returns 404 unexpectedly | the caller is not an active member or the owner (caliber.admin is not an implicit member) |
| 403 saying the token "is bound to project" | the personal access token is bound to a different project than the one named in the header or URL |
| Write request fails in a browser-like flow | missing or stale CSRF token |
| HTTP integration works but Python code does not | SDK client config, auth setup, or server compatibility |
| Python code works but raw HTTP does not | missing auth header, wrong base path, or missing project header |