A tool registry describes available capabilities; a policy engine decides whether a specific actor may execute a specific call in current context. Keep discovery, model selection, authorization, approval, execution, and verification separate. The model can choose among visible tools, but it cannot grant itself a tool, tenant scope, credential, or exception.
You will define tool and policy contracts, filter the visible tool set, and enforce allow, deny, or approval decisions at execution time.
Keep handlers in the registry by internal reference; do not serialize code into model context.
Inputs include authenticated identity, tenant, tool/version, normalized arguments, resource attributes, data classification, environment, and current approval. Outputs must be explainable and auditable.
SDK guardrails, permissions, and hooks can enforce local pieces; the central harness policy keeps business rules consistent across providers.
Failure injection: Change an argument after approval but before execution. The proposal hash and policy engine must reject the call.
Use table-driven tests for actors, tenants, tools, risk, environments, approval state, and time. Add deny-by-default and unknown-version tests. Run the same policy suite through both provider adapters.
Implement a table-driven policy evaluator and prove with property tests that unknown tools, schemas, tenants, or actors always deny.