Workload identity
CircleCI Cloud workloads
Exchange CircleCI's V3 job token for short-lived access to one Bulgur environment.
Before you start
Use CircleCI Cloud and its CIRCLE_OIDC_TOKEN_V3 variable. The V3 token has a fixed CircleCI organization-ID audience for this integration, contains checkout and configuration source/ref claims, and expires after one hour. CircleCI Server is not supported.
CircleCI support requires Bulgur CLI or Node SDK 1.4.0 or newer and a matching server version. CLI/SDK 1.3.0 did not include this provider.
A hosted Bulgur Cloud smoke test passed on 2026-11-07 using CircleCI's native V3 token and the published bulgur@1.4.0 package against https://api.bulgur.dev. CLI run/pull and Node SDK checks covered token exchange and reuse, a session bounded to five minutes and the configured target, the synthetic fixture read, wrong-policy denial (401), sibling-environment denial (404), write denial (403), CLI credential scrubbing, private pull permissions, and request-local SDK reads. Separately, a hosted metadata-only check passed with the published bulgur@1.4.1 package and a native provider token. Earlier isolated API tests covered provider signature/claim denials and policy revision/disable behavior; those checks are separate from the hosted result.
CircleCI SSH reruns are denied. A CircleCI context is required by the policy. A pipeline without checkout/configuration repository claims, including a config source of unknown, cannot match a policy.
Find the policy values
In Bulgur organization settings, create a CircleCI identity and enter the organization UUID, project UUID, and UUID of the CircleCI context used by the job. Copy these canonical UUIDs from CircleCI's organization, project, and context details.
Set checkout source and config source to the exact signed claim values, without https://; for example github.com/acme/app. Set checkout ref and config ref to exact full Git refs such as refs/heads/main or refs/tags/v1.2.0. These source/ref values must match the job token exactly. Values are limited to 512 characters and cannot contain whitespace or wildcards; unknown source values are rejected.
| Bulgur field | CircleCI value |
|---|---|
| Organization ID | CircleCI organization UUID (also the native V3 token audience). |
| Project ID | Project UUID from the V3 token. |
| Checkout source / ref | Repository source without scheme and exact checked-out Git ref. |
| Config source / ref | Repository source and Git ref for the pipeline configuration. |
| Context ID | UUID of the context selected by the CircleCI job; required. |
A context UUID pins the context identity. People who can modify trusted workflows or use that context can use the identity, so protect CircleCI project settings and context access.
Run with the CLI
CircleCI provides CIRCLE_OIDC_TOKEN_V3 to the job. Do not print it or copy it into a persistent project variable. Set the Bulgur identity ID and choose the CircleCI provider mode, then run the command you need.
export BULGUR_AUTH=circleci-oidc
export BULGUR_IDENTITY_ID=<bulgur-identity-id>
npx bulgur run -- ./deploy.shThe CLI requests a fresh Bulgur session as needed. Use CLI 1.4.0 or newer with a server that supports CircleCI.
Use the Node SDK
The SDK reads CircleCI's native V3 token from the job environment. It does not need a CircleCI peer package. Use Node.js 18 or newer with Bulgur SDK 1.4.0 or newer and a matching server.
const { loadValues } = require("bulgur");
async function main() {
const values = await loadValues({
auth: "circleci-oidc",
identityId: process.env.BULGUR_IDENTITY_ID,
});
return values;
}
main().catch(() => {
console.error("Could not load Bulgur values");
process.exitCode = 1;
});Token lifetime and revocation
CircleCI's V3 source token lasts up to one hour and can be reused while valid. Bulgur sessions last at most five minutes. Editing, disabling, or deleting the policy revokes active Bulgur sessions; it does not revoke a CircleCI token.