Evaluate a Policy
Kyndryl Bridge Policy supports remote and local policy evaluation, providing flexible options for evaluating policy decisions based on your environment and requirements. You can evaluate a published Policy Bundle remotely through the Kyndryl Bridge Policy API or locally using the Open Policy Agent (OPA).
Remote Evaluation
Remote Evaluation
To perform a remote evaluation, send a POST request to:
${{BASE_URL}}/policy/bundles/:bundle_key/evaluateProvide the input as the request payload. An access token is required for authentication. For instructions, refer to Obtain a Bearer Token. Bridge Policy evaluates the input and returns the evaluation result.
Example: Evaluating an input using curl
export TENANT_HOSTNAME="<your_tenant_hostname>"
export BUNDLE_KEY="<your_bundle_key>"
export BASE_URL="https://${{TENANT_HOSTNAME}}.bridge.kyndryl.com"
curl -X POST \
"${{BASE_URL}}/policy/v1/bundles/${{BUNDLE_KEY}}/evaluate" \
-H "Authorization: Bearer ${{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-d '{ "key": "value" }' Considerations:
- The bundle must be published first using /v1/bundles/:uuid_or_key/publish
- The path parameter specifies which Rego rule to evaluate
- The request body contains the input data for policy evaluation
Path Parameter Format:
- Format: data.<package>.<rule> (e.g., data.authz.allow, data.rbac.user_allowed)
- Default: data.system.main if path is not provided
- Allowed characters: a-z, A-Z, 0-9, ., _, []
Token Forwarding:
Set token-forward=yes query param to inject the Bearer token into the evaluation input as input.token. This allows policies to validate JWTs or make authorization decisions based on the caller's identity.
Example Request Body:
{"user": "alice", "action": "read", "resource": "document123"} Authorizations:
Authorization string required Type "Bearer" followed by a space and JWT token.
Path parameters:
The uuid_or_key string is required
Bundle UUID (e.g., d3b07384-d9a1-4c2f-8b5e-6c7f8e0b1c2d) or Key (e.g., my_bundle)
The path string is required
Rego evaluation path (e.g., data.authz.allow). Use 'data.system.main' for default entry point. Query parameters:
Token-forward string · enum optional
Set to 'yes' to forward Bearer token into evaluation
Possible values: yes no Body:
object optionalResponses :

Local Evaluation
To perform a local evaluation, download the OPA open-source binary from Download OPA and use the OPA CLI to retrieve the Policy Bundle from Kyndryl Bridge Policy. An access token is required for authentication. For instructions, refer to Obtain a Bearer Token.
Using OPA binary in eval mode
In eval mode, OPA evaluates the Policy Bundle and returns the result. Because OPA cannot download the Policy Bundle in this mode, you must download it before running the evaluation.
To perform a local evaluation in OPA eval mode, first download the Policy Bundle using curl, and then run OPA against the downloaded bundle and your input file. Follow these steps:
- Download the OPA bundle via curl:
export TENANT_HOSTNAME="<your_tenant_hostname>"
export BUNDLE_KEY="<your_bundle_key>"
export BASE_URL="https://${{TENANT_HOSTNAME}}.bridge.kyndryl.com"
curl "${{BASE_URL}}/policy/v1/bundles/${{BUNDLE_KEY}}" \
-H "Authorization: Bearer ${{ACCESS_TOKEN}}" \
-H "Accept: application/gzip" \
-o bundle.tar.gz 2. Run OPA in eval mode:
opa eval \
--bundle bundle.tar.gz \
--input input.json \
--format pretty "data.system.main" Using OPA server mode
In OPA server mode, OPA runs as a service that periodically retrieves updated Policy Bundle versions and listens for evaluation requests. By default, the OPA server listens on http://localhost:8181.
To configure OPA server mode and perform a local evaluation, follow these steps:
- Create a config.yaml file that contains the following information:
services:
kyndryl:
url: https://${{TENANT_HOSTNAME}}.bridge.kyndryl.com/policy/bundles
credentials:
bearer:
token: "<ACCESS_TOKEN>"
bundles:
evaluation:
service: kyndryl
resource: <bundle_key> - Start OPA:
opa run --server --config-file config.yaml - Request a local evaluation:
curl -X POST http://localhost:8181/v1/data/system/main \
-H "Content-Type: application/json" \
-d '{ "key": "value" }' Obtain a Bearer Token
Use the following API call to create a Bridge Bearer Token:

Example TENANT_HOSTNAME and TENANT_ID values:
