Skip to main content

Context and Scope

Scope defines the boundary within which an operation executes. Context provides the environmental information needed for execution.

Scope Levels​

ScopeDescriptionExample
publicAvailable without authenticationProduct search, help pages
userAffects only the signed-in user's own dataProfile updates, cart operations, order history
tenantAffects data shared across the user's organizationMulti-tenant SaaS operations, team settings
globalAffects every tenant or the whole platformPlatform-wide configuration (rare, admin-only)

These four are the whole set. Narrower boundaries — a catalog, a session, a customer account — are expressed with tenant or user plus axag-required-roles and preconditions, not new scope values.

Changed in 1.1

Earlier drafts of this page listed catalog, organization, session and customer. They were never accepted by the manifest schema or tooling.

Why Scope Matters​

An agent operating within a multi-tenant SaaS product must know that tenant scope means operations are isolated to the current tenant. Without this declaration, an agent might attempt cross-tenant operations that should be forbidden.

Context Inheritance​

A container can declare scope, tenant boundary and roles once for every annotation inside it:

<div axag-scope="tenant" axag-tenant-boundary="strict">
<button axag-intent="user.create" axag-entity="user" axag-action-type="write">
Add User
</button>
<!-- This button inherits scope="tenant" and tenant-boundary="strict" -->
</div>

Generators copy the inherited values into each action, so the manifest — and @web-axag/server, which enforces from it — sees scope: "tenant" on the button. See Context Inheritance.

Next Steps​