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.

Context: Official docs (Topaz Policy Lifecycle): documents a gotcha that trips agents building Aserto policies with the policy CLI. If policy build fails with rego_type_error: 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.