Skip to main content
In addition to the Rego builtin functions, Chainloop’s Rego engine has been enhanced with additional functions that can be used to interact with Chainloop APIs and features. All API calls to Chainloop services will use the same authentication context configured in the CLI (by using chainloop auth login or CHAINLOOP_TOKEN). This is the list of APIs supported currently:

chainloop.discover

Calls Chainloop’s Discover API. It’s the same as chainloop discover --digest sha256:foobar Usage: chainloop.discover(digest, kind) Arguments:
  • digest (string): artifact digest in the form of sha256:foobar
  • kind (string, optional): optional filter by kind to disambiguate
Returns: same payload as chainloop discover CLI call. A JSON with the artifact metadata and the list of referenced artifacts. Example:

chainloop.evidence

Lists evidence stored in the platform by querying the Evidence service (see API Reference - EvidenceService/List). Use this to retrieve evidence metadata across projects and workflows for compliance validation.
This feature is only available on Chainloop’s platform paid plans.
Usage: chainloop.evidence(filters) Arguments:
  • filters (object): filter object with optional fields:
    • project_name (string, optional): name of the project to filter by
    • project_version_name (string, optional): name of the project version to filter by
    • kind (array of strings, optional): array of material types to filter by (e.g., ["SBOM_CYCLONEDX_JSON", "HELM_CHART"])
    • workflow_name (array of strings, optional): array of workflow names to filter by
    • search (string, optional): search term to filter evidence by name or subject name
    • latest (boolean, optional): if true, only the latest evidence for each kind and name is returned
    • hide_attestation (boolean, optional): if true, excludes attestation evidence from the results
    • product_id (string, optional): ID of the product to filter evidence by
    • product_version_id (string, optional): ID of the product version to filter evidence by
    • limit (number, optional): maximum number of results to return per page
Returns: object with evidence data. Example:
Example usage:

chainloop.project_compliance

Retrieves project-level compliance data (see API Reference - ComplianceService/Get project-level compliance evaluation) for all requirements. Use this to check compliance status for a project version.
This feature is only available on Chainloop’s platform paid plans.
Usage: chainloop.project_compliance(filters) Arguments:
  • filters (object): filter object with:
    • project_version_id (string, required): UUID of the project version to check compliance for
    • framework_ids (optional): array of framework IDs. If not provided, returns requirements from all frameworks associated with the project version
    • limit (number, optional): maximum number of results to return per page
Returns: object with compliance evaluation data. Example:
Example usage:

chainloop.evidence_prompt

Evaluates evidence using AI-powered analysis. The function sends evidence content along with a prompt to an AI agent for evaluation, enabling automated compliance checks such as license analysis, vulnerability assessment, or custom validation logic.
This feature is only available on Chainloop’s platform paid plans.
Usage: chainloop.evidence_prompt(evidence, prompt) Arguments:
  • evidence (string): CAS digest (sha256:...) or raw evidence content to evaluate
  • prompt (string): the prompt to be passed on to the AI agent for evaluation
Returns: response object with the AI evaluation result. Example:
When the AI analysis is skipped (e.g., if the feature is not enabled), skipped will be true and violations will be empty. Example usage:

chainloop.download_artifact

Downloads an artifact using the Chainloop CAS service. It allows to inject content into policy evaluation context. Note that binary content will be encoded as base64.
This feature is only available on Chainloop’s platform paid plans.
Usage: chainloop.download_artifact(digest) Arguments:
  • digest (string): CAS digest (sha256:...) of the artifact to download
Returns: raw artifact content. Example usage: