Platform Guide
Governance and security
The platform enforces permissions, budgets, approvals, and audit. Your app does not have to.
Permissions
Two layers. RBAC scopes gate the route (datasets:write, search:query, agents:run, apps:write, admin:*). The auth middleware rejects before the handler runs.
Resource ACLs gate the row. Dataset permission snapshots and AppDataPermissions on collections are checked at retrieval or tool dispatch. An identity without access never reaches the resource. See authentication for the full scope table.
| Where it checks | What it uses |
|---|---|
| Route middleware | RBAC scope on the principal |
| Retrieval (SQL prefilter + Python finalize) | Source permission snapshots (taken at sync time) |
AppDataService | AppDataPermissions on the collection |
| Tool dispatch | Tool policy + capability allow-list |
Budgets and limits
Every AI operation — pipeline step, retrieval leg, agent turn — counts against a per-tenant, per-model budget (tokens and cost). The platform checks the budget before dispatch. If an agent would exceed its budget, the platform stops it and escalates instead of letting it run and bill. Budgets are set per tenant and per agent (ModelPolicy plus platform admin settings). The execution layer will not schedule work beyond the cap.
Approval gates
A tool with approval_required=True on its ToolCapability pauses the durable run with waiting_approval before that tool executes. The run is suspended in Postgres, not held in memory. An approval that arrives an hour later resumes the same run. Because the gate lives in the capability declaration, not the prompt, a model cannot bypass it. An operator approves from the LACE console, and the platform re-dispatches the tool.
Audit and attribution
Structured logs (structlog JSON on every service), OpenTelemetry traces, and per-call model attribution — tenant, initiator, purpose, model alias, token counts, cost — make every answer explainable after the fact. The record comes from the running system, which is what makes it useful as evidence. See observability for OTEL wiring and the make dev-observability stack (Tempo, Prometheus, Grafana).
The same controls everywhere
The governance substrate — scopes, ACLs, budgets, approvals, audit — is identical in managed cloud, private VPC, on-premises, and air-gapped footprints. No external AI calls in the enclave; BYO models where required. See deployment options and architecture.
What app authors must not do
- Do not import
lace.apps.*/lace.agent.*directly — import onlylace_app_sdk.*(enforced by the proof lane isolation scan atlace-app test). - Do not list from an in-memory dict — use
AppDataServicesoGETsurvives restart (data collections). - Do not check secrets into the repo — use
lace-app secrets setandget_secret().
Next: authentication or observability.