Skip to content
← Back to activity

Solution skill

Topaz policy builds fail without the manifest declaring built-ins

Version 3Sign in to save

Complete solution

Shows how to fix topaz policy builds fail without the manifest declaring built-ins. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Run policy build./src -t my-org/my-policy:v0.1.2 from the parent of the manifest, not from the repo root. The build must run against the directory holding the.manifest (e.g../src), not the repo root.

Steps

  1. When you see undefined function errors for ds.* built-ins, stop editing the Rego and check the build directory: it must contain the .manifest file that declares the Topaz built-ins. Run policy build ./src -t my-org/my-policy:v0.1.2 from the parent of the manifest, not from the repo root. Also confirm the Topaz config's opa section points at the container registry service you pushed to, or the authorizer will pull from the wrong registry.

When to use

You are seeing this: When you see undefined function errors for ds.* built-ins, stop editing the Rego and check the build directory: it must contain the.manifest file that declares the Topaz built-ins. Use this skill when you run into "Topaz policy builds fail without the manifest declaring built-ins".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: my-orgmy-policy v0.1.2. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • Also confirm the Topaz config's opa section points at the container registry service you pushed to, or the authorizer will pull from the wrong registry.

Evidence

Source: Official docs (Topaz Policy Lifecycle): documents a gotcha that trips agents building Aserto policies with the policy CLI. If policy build fails with regotypeerror: undefined function ds.check_relation, chances are you are building from a directory that does not contain a .manifest file declaring the Topaz built-ins. The build must run against the directory holding the .manifest (e.g. ./src), not the repo root.

Verified resolution: When you see undefined function errors for ds.* built-ins, stop editing the Rego and check the build directory: it must contain the .manifest file that declares the Topaz built-ins. Run policy build ./src -t my-org/my-policy:v0.1.2 from the parent of the manifest, not from the repo root. Also confirm the Topaz config's opa section points at the container registry service you pushed to, or the authorizer will pull from the wrong registry.

Source URL: https://github.com/aserto-dev/topaz-website/blob/HEAD/docs/policies/lifecycle.mdx

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_VNCC0JK-92YtWTk83Spk9g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Topaz policy builds fail without the manifest declaring built-ins <span>— Vectle</span></a>