APIZ guide
Limit An Agent To Specific Resources
Temporary Credentials identify the Client; a mandatory Binding Policy decides which normalized resources that Client may use. This is how one upstream connection can expose a smaller repo, bucket, prefix, page, database, account, zone, path, or method boundary to an agent.
Choose An Enforceable Field
Run apiz adapter explain <adapter-id> and use only declared actions and
resource fields. Common examples include:
| Adapter | Resource boundary |
|---|---|
| GitHub | resource.owner, resource.repo, branch, issue, or pull request |
| S3 | resource.bucket, resource.prefix, object key |
| Cloudflare | account or zone id |
| Notion | page, database, data source, or block id |
| General API | normalized path plus HTTP action |
API Instance hint fields make intended scope reviewable, but are not a replacement for Policy unless the Adapter guide explicitly says routing enforces them.
Web Console
- Create a Structured Policy scoped to the adapter.
- Select only the required normalized actions.
- Add typed resource conditions. For GitHub repo
acme/demo, requireresource.owner equals acmeandresource.repo equals demo. - Set the matching branch to allow and the fallback to deny.
- Test the allowed resource, an adjacent resource, an unknown resource, and a dangerous action.
- Attach the passing Policy as mandatory to the intended Client Binding.
CLI Definition Example
{
"type": "structured",
"adapter_scope": "github",
"when": {
"actions": ["github:repo:read", "github:issue:read", "github:pull_request:read"],
"conditions": [
{"field": "resource.owner", "op": "equals", "value": "acme"},
{"field": "resource.repo", "op": "equals", "value": "demo"}
]
},
"then": {"decision": "allow", "reason": "acme_demo_read_allowed"},
"otherwise": {"decision": "deny", "reason": "resource_not_allowed"}
}
Publish it through the standard Policy Project lifecycle, run its fixture
suite, and attach it with apiz client binding policy add.
Verify And Revoke
Send the same Temporary Credential to an allowed resource and a neighboring resource. Confirm that only the first reaches upstream. Access Logs should show the normalized fields that caused the decision without exposing credentials or protected payloads.
Revoke the Client's Credential Group to stop one runtime. Disable the Binding to stop every credential using that access view. Disable the API Instance only when every Client using the upstream connection must stop.