@xano/developer-mcp 2.3.0-beta.1 → 2.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli_docs/topics/policy.js +11 -10
- package/dist/meta_api_docs/topics/history.js +6 -4
- package/dist/meta_api_docs/topics/policy.js +14 -9
- package/dist/meta_api_docs/topics/workflows.js +1 -1
- package/dist/xanoscript.js +1 -1
- package/dist/xanoscript_docs/README.md +1 -1
- package/dist/xanoscript_docs/policies.md +64 -50
- package/dist/xanoscript_docs/survival.md +1 -1
- package/dist/xanoscript_docs/working.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -415,7 +415,7 @@ Retrieves XanoScript programming language documentation with context-aware suppo
|
|
|
415
415
|
| `middleware` | Request/response interceptors for functions, queries, tasks, and tools |
|
|
416
416
|
| `branch` | Branch-level settings: middleware, history retention, visual styling |
|
|
417
417
|
| `workspace` | Workspace-level settings: environment variables, preferences, realtime |
|
|
418
|
-
| `policies` | Workspace policy documents: syntax, the check catalogue,
|
|
418
|
+
| `policies` | Workspace policy documents: syntax, the check catalogue, templates and authoring rules |
|
|
419
419
|
|
|
420
420
|
**Examples:**
|
|
421
421
|
```
|
|
@@ -497,7 +497,7 @@ Get documentation for Xano's Meta API. Use this to understand how to programmati
|
|
|
497
497
|
| `realtime` | Real-time channel operations |
|
|
498
498
|
| `file` | File management |
|
|
499
499
|
| `history` | Version history |
|
|
500
|
-
| `policy` | Workspace policies: check catalogue and
|
|
500
|
+
| `policy` | Workspace policies: check catalogue and templates, parse, save, object lookup, evaluate, runs (whole, summary and findings pages), agent skill |
|
|
501
501
|
| `workflows` | Step-by-step workflow guides |
|
|
502
502
|
|
|
503
503
|
**Examples:**
|
|
@@ -18,13 +18,13 @@ export const policyDoc = {
|
|
|
18
18
|
Use the authenticated Xano MCP tools for live tool calls, or these CLI commands for local workspace files. The standalone developer MCP serves this documentation; it does not itself authenticate to your workspace.`,
|
|
19
19
|
ai_hints: `Discover exact check parameters with policy catalogue; each entry carries a human label beside its check id. Native policy parse is the validation authority. The developer MCP's language server checks policy syntax locally, and checks rules only as warnings against its bundled copy of the catalogue, which may be older than the instance. An unknown check id is refused by parse, publish and workspace push with payload.code policy_unknown_check, naming the nearest ids, and the CLI adds a pointer to xano policy catalogue. Do not invent a local policy parser. policy parse prints canonical source, which is sparse and orders params the catalogue's way, so do not read a shorter file as a lost setting.
|
|
20
20
|
|
|
21
|
-
Reads, parsing and evaluation need the workspace:policy permission at read level; creating, updating and deleting need it at create, update or delete level. A refused request prints the platform's message and what to do about it, keyed on the refusal's code: the feature is off, the role lacks the permission (an instance admin grants it; a new token does not help), or the token was created without the scope (create one that has it). workspace push lets unchanged policy files through for any reader; a changed policy file from a caller whose permission does not allow the change refuses the whole push, so exclude them with -e "policies/*" or pull again.
|
|
21
|
+
Reads, parsing and evaluation need the workspace:policy permission at read level; creating, updating and deleting need it at create, update or delete level. policy coverage is the exception: it needs only the object kind's own read permission (workspace:api for an endpoint, workspace:function, workspace:database for a table, ...), never workspace:policy, and a refusal (policy_object_permission_required) names that permission, which the role or, for a Metadata API token, the token's scopes lack. A refused request prints the platform's message and what to do about it, keyed on the refusal's code: the feature is off, the role lacks the permission (an instance admin grants it; a new token does not help), or the token was created without the scope (create one that has it). workspace push lets unchanged policy files through for any reader; a changed policy file from a caller whose permission does not allow the change refuses the whole push, so exclude them with -e "policies/*" or pull again.
|
|
22
22
|
|
|
23
|
-
Policy source uses active = true or active = false before enforcement. The retired lifecycle field is refused. policy list labels rows Active,
|
|
23
|
+
Policy source uses active = true or active = false before enforcement. The retired lifecycle field is refused. policy list labels rows Active, Blocking; Active, Advisory; or Inactive. Inactive policies are saved directly, skipped by branch checks, and reported with status inactive.
|
|
24
24
|
|
|
25
25
|
A parse or validation error in summary output is located at line N, col M, with line 1 the first line, followed by the offending text; -o json keeps the platform payload untouched, whose line and col count from 1 too. Every policy command run with -o json reports its own failure as one object on stdout rather than as prose on stderr: {"error": {"message": "...", "exit": 1}}, and exits 1. Exit 2 is never an error object: it is reserved for blocking findings, which are ordinary results.
|
|
26
26
|
|
|
27
|
-
policy evaluate and workspace push print the platform's policy_check verdict (see the Metadata API policy topic for the statuses). Their exit code follows the import and the blocking policies only: 1 when the import or the request fails, 2 whenever policy_check.blocking is true (an active
|
|
27
|
+
policy evaluate and workspace push print the platform's policy_check verdict (see the Metadata API policy topic for the statuses). Their exit code follows the import and the blocking policies only: 1 when the import or the request fails, 2 whenever policy_check.blocking is true (an active blocking policy has findings; an inactive policy never blocks), and 0 otherwise. A pass, a fail and not_applicable (no active policy on the branch) print a headline with the platform's message; disabled, unavailable, error, any other status (an older instance's forbidden) or no feedback at all print one warning line on stderr with the platform's status and message, and leave the exit code alone. A workspace push by a credential without workspace:policy read gets a policy_check with access: "coverage" and scope: "pushed_objects": only its own findings on the objects the push carried that it may read (the workspace too, for a push carrying workspace.xs and a credential with workspace:settings read), each printed with its policy key and title, rule name, message and Fix: hint under Blocking or Advisory, then a count of the findings on objects the push did not list (On objects this push did not list: N new findings (B blocking), counted, not named.; N findings instead of N new findings when elsewhere.basis is all, no baseline being known, or missing, from an older platform) and the platform's note; it names no run (run_id 0), so the CLI prints no xano policy runs hint. blocking is what a policy reader's push of the same change says, so exit 2 follows it whoever pushes, even with nothing of the credential's own listed. For CI, key on policy_check.blocking in -o json rather than on status: advisory findings arrive as status fail with blocking false. A policy finding never rolls back imported code on a branch that is not live. A push to the live branch is gated before it commits: a 403 policy_gate refusal exits 2, prints the platform's sentence (it names the policies the blocking findings come from, to every caller) and says nothing was imported, lists the blocking findings for a credential with workspace:policy read (anyone else gets the counts and the keys), and under -o json prints {imported: false, refused: <payload>}; --policy-override "<reason>" sends an audited override (workspace:policy update), and --no-transaction to live is refused (exit 1). A create past the plan's per-branch cap is refused with policy_plan_limit, naming the plan. Releases carry policies: release create, push and import print the release's stored policy check; tenant deploy_release --check prints the deploy gate's verdict and --override-reason overrides it; tenant_deploy_request set_status and bypass take --override-policy; a refused deploy exits 2. release deploy --set_live and branch set_live exit 2 when the set-live gate refuses (a refused release deploy keeps the new branch and names it), and function create and function edit exit 2 when the live-branch publish gate refuses the save (nothing is saved); each takes --policy-override "<reason>" (workspace:policy update; only with the user's own reason), a blank one is refused before any request, and any other failure exits 1. A workspace push (its --dry-run too), branch set_live, release deploy --set_live or policy delete (of an active blocking policy) that weakens a blocking policy without workspace:policy update is refused with policy_weakening_permission_required and exits 1, a permission refusal rather than a blocking finding: the CLI prints the platform's sentence and how to go on (leave the policy files out with -e "policies/*"; a deployed release's branch stays and is named), and --policy-override does not lift it. policy parse and policy publish print rule warnings on stderr.
|
|
28
28
|
|
|
29
29
|
A rule with zero objects checked and no findings has status no_objects and message no objects checked. Older stored runs keep pass with checked: 0; readers accept both. The run and policy_check stay pass when nothing failed, and policy_check.message names the unchecked rules. Merge, publish and deploy gates read findings and are unaffected. The CLI summary renders both as no objects checked, never as an error; policy status keeps its no_objects_checked row status.
|
|
30
30
|
|
|
@@ -35,14 +35,14 @@ Publishing an identical definition writes nothing and prints No changes; JSON ou
|
|
|
35
35
|
workspace pull writes policies to policies/<KEY>.xs when the credential can read them (without workspace:policy read the pull succeeds and omits them) and prints one hint after a pull that included them: Run \`xano skills pull\` to install the policies skill for your coding agent (see the skills topic). workspace push includes policies in the normal multidoc import and reports policy_check afterward; the workspace topic covers its -m/--message. sandbox push and ephemeral push (and their --dry-run) and release push carry policy files while the instance's Policies feature is on: a sandbox or ephemeral push lands them without evaluating them (no policy_check), and release push sends policies/*.xs with the rest and prints the release's stored policy check. A release built by release push carries those files only for a caller holding workspace:policy create and update; for anyone else it carries the workspace's live-branch policies instead, and the push prints the platform's policies_skipped message naming the files when they differ from the live ones. release import of an archive that carries policies needs the same workspace:policy create and update: without them the platform refuses it, nothing is stored, and the CLI prints the platform's message and the remedy for the role or the token. A push to a remote tenant, a push to a tenant created before policies (it has no policy table until its next platform update), or any push while the feature is off leaves them out, and the push prints the platform's policies_skipped message once, as a warning naming the files and why. While the instance's Policies feature is off, workspace pull carries no policies (and prints no skills hint) and workspace push leaves its policy files out, printing the platform's one line instead of a policy count. Existing workspace push deletion/sync behavior remains governed by its normal flags.`,
|
|
36
36
|
related_topics: ["workspace", "profile", "branch", "skills"],
|
|
37
37
|
commands: [
|
|
38
|
-
{ name: "policy catalogue", description: "List built-in checks, their schemas and analysis limitations from the instance. The full catalogue is long; --check narrows it to one check id in either output mode, and an unknown id names the closest matches.", usage: "xano policy catalogue [options]", flags: [...flags, { name: "check", type: "string", description: "Show only this check id" }], examples: ["xano policy catalogue -o json", "xano policy catalogue --check object.auth_required"] },
|
|
38
|
+
{ name: "policy catalogue", description: "List built-in checks, their schemas and analysis limitations from the instance, then the templates a policy can start from, grouped under the catalogue's category labels in its order. The full catalogue is long; --check narrows it to one check id in either output mode, and an unknown id names the closest matches. -o json carries the templates with their rules and settings.", usage: "xano policy catalogue [options]", flags: [...flags, { name: "check", type: "string", description: "Show only this check id" }], examples: ["xano policy catalogue -o json", "xano policy catalogue --check object.auth_required"] },
|
|
39
39
|
{ name: "policy list", description: "List policies on the selected branch, each with its active state, id and current version.", usage: "xano policy list [options]", flags, examples: ["xano policy list -b dev -o json"] },
|
|
40
40
|
{
|
|
41
41
|
name: "policy create",
|
|
42
|
-
description: "Create an independent Active, Advisory policy from a platform
|
|
43
|
-
usage: "xano policy create --
|
|
44
|
-
flags: [...flags, messageFlag, { name: "
|
|
45
|
-
examples: ["xano policy create --
|
|
42
|
+
description: "Create an independent Active, Advisory policy from a platform template (the templates policy catalogue lists). Copies the template's sparse settings; every needs path must be filled with --param. Parsed natively before saving. A taken template key gets a free numeric suffix (case-insensitive); a taken explicit --key is refused. Never updates an existing policy and stores no link to the template. Rule warnings go to stderr; -o json prints the saved policy.",
|
|
43
|
+
usage: "xano policy create --template <id> [--key KEY] [--param N.path=JSON ...] [options]",
|
|
44
|
+
flags: [...flags, messageFlag, { name: "template", type: "string", required: true, description: "Template id from the catalogue's templates" }, { name: "key", type: "string", description: "Policy key; defaults to the template's suggested key" }, { name: "param", type: "string", description: "Repeatable N.path=JSON override; rule numbers start at 1, and the N. prefix is optional for a single-rule template" }],
|
|
45
|
+
examples: ["xano policy create --template endpoints_need_login -b dev", "xano policy create --template no_pii_in_responses --key DATA-020 --param 'fields=[\"email\",\"ssn\"]'"],
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
name: "policy parse",
|
|
@@ -53,7 +53,7 @@ workspace pull writes policies to policies/<KEY>.xs when the credential can read
|
|
|
53
53
|
examples: ["xano policy parse policies/AUTH-EXAMPLE.xs", "xano policy parse --file policies/AUTH-EXAMPLE.xs", "cat policies/AUTH-EXAMPLE.xs | xano policy parse --stdin -o json"],
|
|
54
54
|
},
|
|
55
55
|
{ name: "policy publish", description: "Parse one policy, then create or update by its stable key on the selected branch using canonical source. Prints Published KEY (Version N), or No changes to KEY (Version N) when the definition already matches what is stored. Use workspace push for an atomic multi-policy import.", usage: "xano policy publish --file <path> [options]", flags: [...flags, ...sourceFlags, messageFlag], examples: ["xano policy publish --file policies/AUTH-EXAMPLE.xs -b dev", "xano policy publish --file policies/AUTH-EXAMPLE.xs -m \"Tightened the scope\""] },
|
|
56
|
-
{ name: "policy evaluate", description: "Evaluate active policies and store a new run, then print the platform's verdict and the run's findings. Exits 2 when policy_check.blocking is true, and 0 for every other verdict; not_applicable (no active policy) prints a headline with the platform's message and is no run: nothing is stored, so there is no Not stored line and nothing new in policy runs. Only a disabled,
|
|
56
|
+
{ name: "policy evaluate", description: "Evaluate active policies and store a new run, then print the platform's verdict and the run's findings. Exits 2 when policy_check.blocking is true, and 0 for every other verdict; not_applicable (no active policy) prints a headline with the platform's message and is no run: nothing is stored, so there is no Not stored line and nothing new in policy runs. Only a disabled, unavailable or errored verdict prints one warning line. A credential that may read but not write gets its findings with nothing stored, and the CLI says Not stored. --policy KEY tries that one policy alone, even if inactive: nothing is stored or audited, the latest run is untouched, nothing is gated, and each rule's clear objects are named; an inactive trial never exits 2, and a blank key is refused before any request.", usage: "xano policy evaluate [options]", flags: [...flags, { name: "policy", type: "string", description: "Try this one policy key alone (a trial: never stored or audited)" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what this run recorded: each policy's statement and each rule's name and resolved settings" }, { name: "summary", type: "boolean", default: "false", description: "Send answer: summary: answer the run summary (counts, each policy's verdict, rule results) and its first 50 findings instead of the whole run, and say which run has the rest. -o json passes that answer through" }], examples: ["xano policy evaluate -b dev -o json", "xano policy evaluate --run-detail", "xano policy evaluate --summary -o json", "xano policy evaluate --policy AUTH-001"] },
|
|
57
57
|
{
|
|
58
58
|
name: "policy runs",
|
|
59
59
|
description: "List the runs the branch retains (only the newest twenty exist), newest first, with status, finding count, objects checked, trigger and start time. With a run id, read that one run, including one older than the latest, which policy status cannot reach: its summary (counts, each policy's verdict, rule results) and one page of its findings in the platform's order, blocking first, 100 unless --limit says otherwise; a page that is not every finding is marked (one page) and names the next page's --offset. --all reads every page instead (500 a request, saying so on stderr when there are more) and prints or returns every matching finding. The filter flags narrow the findings on the instance; a repeated flag matches any of its values. JSON output is the platform's own body: the run summaries for a list, and for one id the run summary with findings, the page's findings as an array (every one with --all), and findings_page {total, offset, limit, next_offset}, next_offset null after the last. The finding flags need a run id. --release <name> reads a release's policy check (stored when it was cut) the same way, plus its shipped policies; --release-id <id> reads it by id (exclusive with --release and --branch); --recheck checks the release again from its archive and stores the run. Needs the workspace:policy permission at read level.",
|
|
@@ -79,10 +79,11 @@ workspace pull writes policies to policies/<KEY>.xs when the credential can read
|
|
|
79
79
|
],
|
|
80
80
|
examples: ["xano policy runs", "xano policy runs --limit 5", "xano policy runs 1674 --run-detail -o json", "xano policy runs 1674 --offset 100 --limit 100", "xano policy runs 1674 --all -o json", "xano policy runs 1674 --blocking --policy AUTH-001 --severity critical", "xano policy runs --release v1.2", "xano policy runs --release-id 12 --recheck"],
|
|
81
81
|
},
|
|
82
|
+
{ name: "policy coverage", description: "Show one object as Studio's object panel does, from the branch's latest run: the chip (Policies 1 blocking · 1 advisory, Policies ✓ 6 pass, Policies · 3 apply · not checked yet, Policies · Last check failed, Policies · None apply), the object's findings, Blocking then Advisory, each with its policy key and title, rule name, message and Fix: hint, then the policies that apply, each Blocking or Advisory, failing, passing or not checked yet, and why it applies, and the platform's note. Needs only the object kind's own read permission, not workspace:policy, so every credential gets the same trimmed answer (no statements, rule settings, run ids or other objects' findings). The object is written type:id, as findings name it; the workspace object's id is the workspace's own id (workspace:17). -o json is the platform's answer. Exits 0 when it answers, and 1 on a refusal or a malformed type:id. Drafts are checked in Studio (on Save or with Check draft); the CLI reads stored definitions only.", usage: "xano policy coverage <type>:<id> [options]", args: [{ name: "object", required: true, description: "The object, written type:id (query:42, function:12, table:7); for workspace, the workspace's own id (workspace:17)" }], flags, examples: ["xano policy coverage query:42", "xano policy coverage function:12 -b dev -o json"] },
|
|
82
83
|
{ name: "policy delete", description: "Delete a policy from the selected branch, by policy key or by id; its Version History is kept. An unresolved name is refused naming the policies the branch does have. Prompts before deleting; --force skips the prompt. The delete sends the updated_at it listed, so a policy changed after that (for example while the prompt waited) is refused with policy_stale and nothing is deleted: run the command again. This is the only way to remove a policy from the CLI: workspace push is additive, so deleting policies/KEY.xs and pushing leaves the policy in place. Needs the workspace:policy permission at delete level.", usage: "xano policy delete <key-or-id> [options]", flags: [...flags, { name: "force", short: "f", type: "boolean", default: "false", description: "Skip the confirmation prompt; only with the user's explicit confirmation" }], examples: ["xano policy delete TMP-DX-001", "xano policy delete 922 --force -o json"] },
|
|
83
84
|
{
|
|
84
85
|
name: "policy status",
|
|
85
|
-
description: "Inspect stored policy/run state without evaluating. The Enforcement column reads
|
|
86
|
+
description: "Inspect stored policy/run state without evaluating. The Enforcement column reads Blocking or Advisory, and a finding count reads (blocking) when the latest run judged it blocking: the run evaluated the policy in its current version as active and blocking. A policy is stale when it changed after the branch's newest run (the platform's latest_run), so that run's findings no longer describe it. Informational (exit 0) by default; with --fail-on-findings it exits 2 when the latest run has blocking findings, else 1 for stale, missing or errored evaluation evidence (advisory findings still exit 0), and a nonzero exit is always explained by one line naming the reason. A blocking reason is a prediction: the merge gate evaluates the branch again before a merge. In -o json each row's status is one of pass, fail, error, stale, not_evaluated, no_checks, no_objects_checked or inactive, with blocking, rules_unchecked (a pass whose rules checked no objects) and counted (whether its findings come from the latest run's evidence); --fail-on-findings adds fail_on_findings: {exit, reason}. It reads the latest run's summary, not the whole run, so in -o json run carries each policy's finding count and verdict rather than the findings; xano policy runs <id> lists them.",
|
|
86
87
|
usage: "xano policy status [options]",
|
|
87
88
|
flags: [...flags, { name: "fail-on-findings", type: "boolean", default: "false", description: "Exit 2 when the latest run has blocking findings; otherwise exit 1 for stale, missing or errored evaluation evidence" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what the latest run recorded: each policy's statement and each rule's name and resolved settings. Summary output only" }],
|
|
88
89
|
examples: ["xano policy status -b dev -o json", "xano policy status --fail-on-findings -o json", "xano policy status --run-detail"],
|
|
@@ -4,7 +4,7 @@ export const historyDoc = {
|
|
|
4
4
|
description: `History endpoints provide audit logs for API requests and background executions. Use for debugging, monitoring, and compliance.
|
|
5
5
|
|
|
6
6
|
## Available History Types
|
|
7
|
-
- **Request History**: All API requests with timing and responses
|
|
7
|
+
- **Request History**: All API requests with timing and responses (a Metadata API call that carries policy details is masked for a viewer without workspace:policy read)
|
|
8
8
|
- **Function History**: Function execution logs
|
|
9
9
|
- **Task History**: Scheduled task execution logs
|
|
10
10
|
- **Middleware History**: Middleware execution logs
|
|
@@ -20,7 +20,8 @@ export const historyDoc = {
|
|
|
20
20
|
ai_hints: `- Use request history to debug API issues
|
|
21
21
|
- Filter by status to find errors (4xx, 5xx)
|
|
22
22
|
- Use branch filter to separate dev/prod logs
|
|
23
|
-
-
|
|
23
|
+
- Pass include_output=true for each request's output; the input is always returned
|
|
24
|
+
- For a viewer without workspace:policy read (or while the policies feature is off), a Metadata API call that carries policy details (a policy route, a policy refusal, a push's policy_check, a policy document) shows "Hidden: this call carries policy details, which need workspace:policy read." as its whole input and output; an endpoint's own request history is never masked
|
|
24
25
|
- History is limited to recent requests (not permanent storage)`,
|
|
25
26
|
endpoints: [
|
|
26
27
|
{
|
|
@@ -34,7 +35,7 @@ export const historyDoc = {
|
|
|
34
35
|
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
|
|
35
36
|
{ name: "branch", type: "string", description: "Filter by branch name" },
|
|
36
37
|
{ name: "api_id", type: "integer", description: "Filter by API endpoint ID" },
|
|
37
|
-
{ name: "
|
|
38
|
+
{ name: "include_output", type: "boolean", default: false, description: "Include each request's output (response); the input is always returned" }
|
|
38
39
|
]
|
|
39
40
|
},
|
|
40
41
|
{
|
|
@@ -53,7 +54,8 @@ export const historyDoc = {
|
|
|
53
54
|
status: { type: "array", description: "Filter by status codes (e.g., [200, 201])" },
|
|
54
55
|
verb: { type: "array", description: "Filter by HTTP methods (e.g., ['GET', 'POST'])" },
|
|
55
56
|
from_date: { type: "string", description: "Start date (ISO format)" },
|
|
56
|
-
to_date: { type: "string", description: "End date (ISO format)" }
|
|
57
|
+
to_date: { type: "string", description: "End date (ISO format)" },
|
|
58
|
+
include_output: { type: "boolean", description: "Include each request's output (response); the input is always returned" }
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
},
|
|
@@ -32,7 +32,7 @@ export const policyDoc = {
|
|
|
32
32
|
title: "Workspace Policies",
|
|
33
33
|
description: `Policies are branch-scoped workspace XanoScript objects combining a human description and deterministic check rules. These endpoints require a platform build with policy support. Discover supported checks and their exact parameter schemas from the instance; do not invent checks or parameters. The policy language - syntax, fields, rules, refusal messages and versioning - is documented once, in xano_xanoscript_docs({topic: "policies"}) (mode: "quick_reference" for the short form; the full topic carries every check's description); this topic covers the routes.
|
|
34
34
|
|
|
35
|
-
Every route needs the workspace:policy permission: read for the reads, parse, the object lookup and evaluate; create, update or delete for the writes. An OAuth token is also capped by its workspace:read or workspace:write ceiling. A refusal is a 403 whose payload.code names the gate: policy_feature_disabled, policy_permission_required or policy_scope_required (both with permission and level). The OAuth ceiling answers insufficient_scope without a code, and a write from a read-only session (a read-only Studio session or a read-only impersonation) is refused without a code too: This is a read-only session. Enable editing to modify this resource. The policies topic's Permissions section says what each one needs.
|
|
35
|
+
Every route needs the workspace:policy permission: read for the reads, parse, the object lookup and evaluate; create, update or delete for the writes. The one exception is an object's coverage (GET policy/object/coverage), which needs only the object kind's own read permission (workspace:api for an endpoint or API group, workspace:function, workspace:database for a table, workspace:task, workspace:middleware, workspace:addon, workspace:workflow_test, workspace:tool for tools, agents and MCP servers, workspace:realtime for channels and messages, workspace:settings for the workspace; a trigger's by what it is attached to, its obj_type: workspace:database for a table trigger, workspace:tool for an agent or MCP server trigger, workspace:realtime for a realtime trigger, instance:workspace for a workspace or error trigger and for a trigger the branch does not hold, and all four for one whose obj_type cannot be resolved; a trigger the caller may not use is answered exactly as one the branch does not hold, refused naming instance:workspace or a 404 to a caller who holds it, so its existence never shows) and never workspace:policy; it refuses with 403 policy_object_permission_required {permission, level: "read", type}. An OAuth token is also capped by its workspace:read or workspace:write ceiling. A refusal is a 403 whose payload.code names the gate: policy_feature_disabled, policy_permission_required or policy_scope_required (both with permission and level). The OAuth ceiling answers insufficient_scope without a code, and a write from a read-only session (a read-only Studio session or a read-only impersonation) is refused without a code too: This is a read-only session. Enable editing to modify this resource. The policies topic's Permissions section says what each one needs.
|
|
36
36
|
|
|
37
37
|
The native platform parses and formats policy source. Send source alone inside data, or structured fields without source; never both. Canonical source is server-owned. A write answers the policy as GET serves it, plus unchanged: an unchanged save writes nothing and answers unchanged: true. PUT and DELETE take an optional last_updated_at, the updated_at you last read: a write or delete over a newer change is refused with HTTP 400 and payload.code policy_stale, and nothing changes. A source error is a 400 whose payload.line and payload.col count from 1, like the message. A rule naming a check id the instance does not have is refused on parse, save and push with HTTP 400 and payload {code: "policy_unknown_check", check} (the id as written); the message names the nearest ids and the catalogue route, and a client keys its own pointer to the catalogue on the code.
|
|
38
38
|
|
|
@@ -40,26 +40,31 @@ Every policy the list, a GET and a write serve carries latest_run {run_id, inclu
|
|
|
40
40
|
|
|
41
41
|
A rule with zero objects checked and no findings has status no_objects and message no objects checked. Older stored runs keep pass with checked: 0; readers accept both. The run and policy_check stay pass when nothing failed, and policy_check.message names the unchecked rules. Merge, publish and deploy gates read findings and are unaffected.
|
|
42
42
|
|
|
43
|
-
A policy_check block reports an evaluation. status is one of: pass ("No policy findings."), fail ("Policies reported findings."), error ("A policy check could not run; its result is marked error."), not_applicable ("No active policies on this branch; nothing was evaluated."), disabled ("Policies are not enabled on this instance; nothing was evaluated.")
|
|
43
|
+
A policy_check block reports an evaluation. status is one of: pass ("No policy findings."), fail ("Policies reported findings."), error ("A policy check could not run; its result is marked error."), not_applicable ("No active policies on this branch; nothing was evaluated."), disabled ("Policies are not enabled on this instance; nothing was evaluated.") or unavailable ("Policy evaluation is unavailable; the import itself completed."), and message carries that sentence. blocking is true when an active blocking policy has findings, and status is then fail even if a check errored. not_applicable and disabled load, store and audit nothing. Evaluate answers pass, fail, error or not_applicable; the feature gate and the permission refuse it with a 403 instead. A not_applicable evaluate is no run: id 0, stored: false, the run's own status not_applicable too, and empty policies, results and findings. The workspace multidoc import answers all six. Its findings and blocking_findings list the first 100 each, in the platform's order, beside counts {findings, blocking, errors}, total (every finding) and truncated (whether either list was cut); the stored run (run_id) has them all, and its results are whole; a draft import answers no policy_check. A caller without workspace:policy read is evaluated the same way (the run is stored) but told only their own findings on the objects the import carried that they may read (an import carrying the workspace document carries the workspace object too, listed to a caller with workspace:settings read): {status, message, blocking, run_id: 0, access: "coverage", scope: "pushed_objects", findings, blocking_findings, elsewhere {total, blocking, basis}, results: [], counts, total, truncated, note}, each finding trimmed as an object's coverage trims it (below). counts are about the listed findings, except counts.errors (the branch's rules that could not run). elsewhere counts, never names, the findings on the objects it does not list: with basis "introduced", those the import introduced (on the live branch, not in the push gate's own evaluation of the branch just before the import; on any other branch, not in the branch's newest run just before the import while that run still described the branch); with basis "all", when no such baseline was known, every finding there, existing ones included. Which objects are the caller's follows the coverage route's permissions, a trigger by its obj_type. blocking is what a reader's import of the same change says (the branch holds a blocking finding after it), so it can be true with nothing listed; status is fail when anything is listed, elsewhere.total is above 0 or blocking is true, else error when a rule errored, else pass. An older platform answers such a caller forbidden ("This credential cannot read this workspace's policies (workspace:policy read); nothing was evaluated.") and evaluates nothing. A tier1 tenant, ephemeral or sandbox push and its dry run, and a release built from a multidoc (release push), carry policy files while the feature is on; a tenant or sandbox push carries them without evaluating them and answers no policy_check, and a release built from a multidoc carries its files only for a caller holding workspace:policy create and update (for anyone else it carries the workspace's live-branch policies instead, and names the files in policies_skipped when they differ from the live ones). A remote tenant push, a push to a tenant without a policy table (one created before policies, until its next platform update), or any push while the feature is off leaves them out and names them once in policies_skipped {message, keys}, whose message says why ("N policy files were left out (KEY, KEY): <reason>."). With the policies feature off a workspace push and its dry run leave them out too (policy_check disabled), exports omit policies, and an archive import leaves its policies out and keeps the workspace's own, except that a replace deletes the policies of the branches it removes.
|
|
44
44
|
|
|
45
|
-
Gates: a merge, a set-live, an archive import with mode=merge, and a save or a non-draft push to the workspace's live branch are refused with HTTP 403 and payload.code policy_gate when they introduce a blocking finding or leave one on an object they change; existing findings elsewhere never block. The payload is {gate, status, total, introduced, changed, existing, run_id, can_override, findings (first 100, policy readers only), truncated}. A tenant release deploy is refused the same way when the release's own policy check has any blocking finding, existing debt included: it judges the release alone, never against the tenant's current release, so a release gets the same verdict on every tenant (ephemeral and sandbox tenants get it with gated false and are never refused). Its payload is {gate, status, total, run_id, can_override, gated, release {id, name, run_id, status, counts, carried}, message, findings, truncated}. A caller with workspace:policy update may proceed by resending with override_reason (the create and save routes of the gated objects, the multidoc, upload, import and branch live routes, a release deploy with set_live and import-schema with setlive; override_policy with the reason on tenant deploys), which is audited. A release deploy with set_live and an import-schema with setlive land the new branch first and then run the set-live gate, so a refusal keeps that branch and names it in payload.branch {id, label}. Gates are decided by the policies the branch will have after the change (a merge's carried policies, a push's policy files, the set-live candidate's own policies), so a merge, a push to the live branch or a set-live that weakens a policy active and
|
|
45
|
+
Gates: a merge, a set-live, an archive import with mode=merge, and a save or a non-draft push to the workspace's live branch are refused with HTTP 403 and payload.code policy_gate when they introduce a blocking finding or leave one on an object they change; existing findings elsewhere never block. The message names the policies the blocking findings come from to every caller, e.g. Push refused: 2 blocking policy findings from AUTH-010 and PII-001 (1 introduced by this change, 1 on objects it changes). The payload is {gate, status, total, introduced, changed, existing, run_id, can_override, sources, findings (first 100, policy readers only), truncated (policy readers only)}. sources is the message's list ("from AUTH-010 and PII-001"), to every caller whenever the blocking findings name a policy; every gate answer carries it (a merge's and its dry run's policy_gate, a set-live's, the tenant deploy gate's and a refusal's payload). A tenant release deploy is refused the same way when the release's own policy check has any blocking finding, existing debt included: it judges the release alone, never against the tenant's current release, so a release gets the same verdict on every tenant (ephemeral and sandbox tenants get it with gated false and are never refused). A rule that cannot run on an active blocking policy makes the branch gates unavailable, and the change goes through ungated until every rule can run; a tenant deploy still refuses a release with blocking findings, and a release without one whose check has a rule that could not run is unavailable and not gated. Its payload is {gate, status, total, run_id, can_override, gated, release {id, name, run_id, status, counts, carried}, message, sources, findings, truncated}, findings and truncated for policy readers only, its message naming the blocking policies to everyone. A caller with workspace:policy update may proceed by resending with override_reason (the create and save routes of the gated objects, the multidoc, upload, import and branch live routes, a release deploy with set_live and import-schema with setlive; override_policy with the reason on tenant deploys), which is audited. A release deploy with set_live and an import-schema with setlive land the new branch first and then run the set-live gate, so a refusal keeps that branch and names it in payload.branch {id, label}. Gates are decided by the policies the branch will have after the change (a merge's carried policies, a push's policy files, the set-live candidate's own policies), so a merge, a push to the live branch or a set-live that weakens a policy active and blocking on the branch (demotes, deactivates or deletes it, or loosens a rule) needs workspace:policy update: otherwise it is refused before anything is written with 403 policy_weakening_permission_required and {gate, permission, level, policies}, which override_reason does not lift, and the push dry run is refused the same way. A set-live of a branch that landed no policy (an import-schema with setlive always leaves the archive's policies out; a release may carry none) is judged by the live branch's policies, with no weakening check. A set-live check that cannot read the policies fails closed (only update proceeds; the refusal carries unavailable: true). Deleting an active blocking policy needs workspace:policy update as well as delete (the same 403, gate delete), and so does an archive import with mode=replace or delete=true that would remove one from the branch it writes (gate archive_import). The publish gate covers the draftable kinds (function, query, task, middleware, addon, tool, workflow test, trigger and realtime message), agents, MCP servers and realtime channels: tables, API groups, environment variables, workspace and branch settings, realtime servers, and MCP prompts and resources are saved without it, even on the live branch, and the next run reports what they break while a set-live or tenant deploy that carries it is gated. Adding a prompt or resource to an MCP server, or removing one, changes the server, so that save is gated. A push to the live branch needs its transaction (400 policy_gate_transaction_required). Pushes to other branches are not gated: they answer policy_check after the import. A create past the plan's per-branch policy cap (lower plans cap the policies on each branch; Pro and above are unlimited) is refused with 403 policy_plan_limit; a save whose key another live policy on the branch holds (compared case-insensitively) with 400 policy_key_taken (with key, existing_key and existing_id, null when a concurrent create took the key first); a create whose rules exactly match a live policy on the branch with 400 policy_duplicate (with existing_key, existing_id and policies); a draft import carrying a changed policy with 400 policy_draft_import (Policies are saved directly, not drafted.).
|
|
46
46
|
|
|
47
47
|
Releases carry their branch's policies and store a policy check when cut. An uploaded release archive (release/import) that says it carries policies needs workspace:policy create and update, or is refused with 403 policy_permission_required and nothing is stored. Routes: GET /workspace/{workspace_id}/release/{release_id}/policy_run (POST re-checks it), .../policy_run/findings, and GET /workspace/{workspace_id}/release/policy_check?release_id[]= for several (at most 200 ids). GET /workspace/{workspace_id}/tenant/{tenant_name}/policy_gate?release_name= previews a tenant deploy's gate, and GET /workspace/{workspace_id}/tenant/{tenant_name}/policy lists a tenant's policies; both need tenant_center read besides workspace:policy read.
|
|
48
48
|
|
|
49
49
|
Policies expose active as a boolean (default true). Source always writes active = true or active = false before enforcement. Authored lifecycle is refused: policy: "lifecycle" was replaced by "active"; write active = true or active = false. Source refusals include line and column. An inactive policy may have no rules. Policies are saved directly, not drafted.
|
|
50
50
|
|
|
51
|
-
An evaluation stores a run and its findings; it does not modify the policy. Findings arrive in one order: blocking first, then by severity, policy key, rule position (R2 before R10) and object. A run can hold tens of thousands of findings (85,855 findings is a 44 MB run), so read a large one in parts: GET run/{run_id}/summary serves it without its findings, with its counts, each policy's verdict and the facets, and GET run/{run_id}/findings serves its findings a page at a time, filtered on the instance. Evaluate with answer: "summary" answers the same way, with the first 50 findings. Checks are static: they inspect stored definitions and nothing runs at request time. A check passing is not proof of runtime behavior or compliance.`,
|
|
51
|
+
An evaluation stores a run and its findings; it does not modify the policy. Evaluations, the gates' included, share a small pool of slots; a slot's lease is renewed between rules while its evaluation runs, so a slow branch keeps its slot, and a worker that dies frees it when the lease runs out. Studio's merge review (not a Metadata API route) answers a member without workspace:policy read trimmed, at most 20 a minute per member and workspace (429 policy_merge_review_rate_limited with retry_after; a reader's review is not limited). Findings arrive in one order: blocking first, then by severity, policy key, rule position (R2 before R10) and object. A run can hold tens of thousands of findings (85,855 findings is a 44 MB run), so read a large one in parts: GET run/{run_id}/summary serves it without its findings, with its counts, each policy's verdict and the facets, and GET run/{run_id}/findings serves its findings a page at a time, filtered on the instance. Evaluate with answer: "summary" answers the same way, with the first 50 findings. Checks are static: they inspect stored definitions and nothing runs at request time. A check passing is not proof of runtime behavior or compliance. Drafts are checked in Studio only (on a XanoScript save or with Check draft, nothing stored); the Metadata API has no draft check, so evaluate after a change is saved or pushed.`,
|
|
52
52
|
ai_hints: `Use the authenticated Xano MCP policy tools when available. Their workspace and instance come from the authenticated request, not tool arguments. The standalone developer MCP offers documentation and local language-server validation; it does not carry a workspace credential. Validate policy source with the native policy/parse endpoint before saving; the developer MCP's local validation is a preview against its bundled catalogue. Key refusals on payload.code, never on the message wording. Read latest_run.stale to know whether a run still describes a policy. Evaluate with answer: "summary" and page a run's findings with GET run/{run_id}/findings rather than reading a large run whole. Re-sending an identical definition is safe: the platform answers unchanged: true and writes nothing, so do not add a cosmetic edit to force a new version.`,
|
|
53
53
|
related_topics: ["workspace", "branch", "authentication"],
|
|
54
54
|
endpoints: [
|
|
55
|
-
{ method: "GET", path: prefix + "/check", description: "The check catalogue: items (each check's id, label, description, keywords, supported object kinds and full parameter schema)
|
|
55
|
+
{ method: "GET", path: prefix + "/check", description: "The check catalogue: items (each check's id, label, description, keywords, supported object kinds and full parameter schema), templates (the starting points a new policy can be created from, each with its category id, framework tag ids, title, summary, key, severity and the rules it seeds, the needs the author fills (every one, or at least one when the rule's needs_any is true) and a limits note on what its rules cannot see; see the policies topic) template_categories (the category ids with their labels, in the order to offer them), template_frameworks (the framework tag ids with their labels, in order: a tag marks a related topic and never means a policy or workspace is compliant) and template_frameworks_note (the sentence to show wherever the tags appear).", parameters: [workspace] },
|
|
56
56
|
{ method: "GET", path: prefix, description: "List policies on a branch, 1000 a page (nextPage says whether there are more). Each item is served as GET serves one policy, with latest_run.", parameters: [workspace, branch, { name: "page", type: "integer", in: "query", default: 1, description: "Page number" }] },
|
|
57
57
|
{ method: "GET", path: prefix + "/{policy_id}", description: "Read one policy on the selected branch, with latest_run. source is canonical, so it can be sent back to PUT unchanged (a no-op) or edited. A policy that is not live on the branch answers 404 Policy not found on this branch of the workspace., as PUT and DELETE do.", parameters: [workspace, policyId, branch] },
|
|
58
58
|
{
|
|
59
59
|
method: "GET", path: prefix + "/object", description: "The active policies whose rules reach one object, why each rule applies, and that object's findings in the branch's newest run. An unknown type is a 400 naming the known types; an object the branch does not have is a 404.",
|
|
60
|
-
parameters: [workspace, branch, { name: "type", type: "string", required: true, in: "query", description: "Object kind as findings name it: query, function, table, task, trigger, message and the other kinds the catalogue lists" }, { name: "id", type: "integer", required: true, in: "query", description: "Object ID on the selected branch" }],
|
|
60
|
+
parameters: [workspace, branch, { name: "type", type: "string", required: true, in: "query", description: "Object kind as findings name it: query, function, table, task, trigger, message and the other kinds the catalogue lists" }, { name: "id", type: "integer", required: true, in: "query", description: "Object ID on the selected branch; for workspace, the workspace's own id" }],
|
|
61
61
|
response: { type: "object", description: "{object, policies: [{id, key, title, statement, severity, active, enforcement, tag, rules: [{id, title, check, label, reason, warnings}], latest_run}], run: {id, started_at, status, policies: [{key, blocking}]} | null, findings}. policies come from the policies as they are now; findings come from the newest stored run, and run.policies names each policy whose findings are listed, with blocking from the run's snapshot." },
|
|
62
62
|
},
|
|
63
|
+
{
|
|
64
|
+
method: "GET", path: prefix + "/object/coverage", description: "One object's coverage for anyone who may read the object: the active policies that apply to it and why, and its findings in the branch's newest run, trimmed. Needs the object kind's own read permission, never workspace:policy (403 policy_object_permission_required {permission, level, type}: Reading this function needs the workspace:function read permission.), and answers every caller, policy readers included, the same trimmed shape (a reader wanting more reads GET /policy/object). An unknown type is a 400 naming the known types; an object the branch does not have is a 404 No <type> with id <id> on this branch. The answer is the same for every caller and is cached for 60 s by object, the branch's latest run and the workspace checksum with the policies' fingerprint, so a write, a policy change or a new run misses the cache. Request history shows its rows Hidden to viewers without workspace:policy read, as for every policy route.",
|
|
65
|
+
parameters: [workspace, branch, { name: "type", type: "string", required: true, in: "query", description: "Object kind as findings name it: query, api_group, function, table, task, trigger, middleware, addon, workflow_test, tool, agent, mcp_server, channel, message or workspace" }, { name: "id", type: "integer", required: true, in: "query", description: "Object ID on the selected branch; for workspace, the workspace's own id (type=workspace&id=17 on workspace 17)" }],
|
|
66
|
+
response: { type: "object", description: "{access: \"coverage\", object {type, id, name, app_id?}, summary {state, applies, blocking, advisory, passing, not_checked}, policies: [{key, title, enforcement, blocking, status, reasons}], findings, run: {started_at, status} | null, note}. state is the panel chip: none_apply, findings (Policies <blocking> blocking · <advisory> advisory), not_checked (<applies> apply · not checked yet), check_failed (Last check failed) or pass (Policies ✓ <passing> pass). policies are computed now (a policy saved after the run is not_checked); status is failing, passing (the newest run evaluated its current version without an error and found nothing here) or not_checked; reasons say in plain words why each applies. findings are the newest run's on this object, each {id, policy_key, policy_title, rule_title, message, blocking, deleted (the run evaluated a policy the branch no longer holds), object, check: {label, description (first sentence), fix_hint} | null}. Never sent: statements, rationale, narrative, tags, severity, rule ids, check ids, params, settings, warnings, allow fingerprints, policy or run ids, other objects' findings. note is the fixed sentence Full policy details need the workspace:policy read permission." },
|
|
67
|
+
},
|
|
63
68
|
{
|
|
64
69
|
method: "POST", path: prefix + "/parse", description: "Parse and format one policy with the native platform parser, without saving it. Send exactly one of source or data.", parameters: [workspace],
|
|
65
70
|
request_body: { type: "object", properties: { source: { type: "string", description: "One complete policy XanoScript document" }, data: { type: "object", description: "Structured policy fields instead of source" }, branch: { type: "string", description: "Optional branch label to check rule warnings against" } }, example: { source: policyExample } },
|
|
@@ -95,13 +100,13 @@ An evaluation stores a run and its findings; it does not modify the policy. Find
|
|
|
95
100
|
{
|
|
96
101
|
method: "GET", path: prefix + "/run", description: "List the retained runs newest first, as summaries: the findings, per-rule results and policy snapshots are on the single run. Only a branch's newest twenty runs are retained.",
|
|
97
102
|
parameters: [workspace, branch, { name: "limit", type: "integer", in: "query", default: 20, description: "How many runs to return, 1-20" }],
|
|
98
|
-
response: { type: "object", description: "{items, curPage, nextPage, prevPage}; each item is {id, created_at, trigger, actor, started_at, finished_at, status, objects_checked, counts: {findings, blocking, errors}, policies: [{id, key, version, enforcement, status, findings, blocking, objects_checked}], branch}: each policy with its verdict in that run" },
|
|
103
|
+
response: { type: "object", description: "{items, curPage, nextPage, prevPage}; each item is {id, created_at, trigger, actor, started_at, finished_at, status, objects_checked, counts: {findings, blocking, errors}, policies: [{id, key, version, enforcement, status, findings, blocking, objects_checked, errors}], branch}: each policy with its verdict in that run, errors counting its rules that could not run (0 while the run is in flight)" },
|
|
99
104
|
},
|
|
100
105
|
{ method: "GET", path: prefix + "/run/{run_id}", description: "Read one retained run in full: findings, per-rule results and the policies[] snapshot of what it checked (each policy's statement and, per rule, its label and resolved params). A run is served whole, all its findings included, so read a large one through its summary and findings pages below. An evicted run or another branch's answers 404 Policy run not found on this branch of the workspace, as its summary and findings do. Only a branch's newest runs are retained.", parameters: [workspace, branch, runId] },
|
|
101
106
|
{
|
|
102
107
|
method: "GET", path: prefix + "/run/{run_id}/summary", description: "Read one retained run without its findings: what it adds up to, stored with the run when it was kept (a run kept before summaries is summarised on read).",
|
|
103
108
|
parameters: [workspace, branch, runId, { name: "object_limit", type: "integer", in: "query", default: 100, description: "The most objects the object facet names, 1-1000; facets.object.total counts them all" }],
|
|
104
|
-
response: { type: "object", description: "{id, created_at, updated_at, trigger, actor, started_at, finished_at, status, objects_checked, branch, counts: {findings, blocking, advisory, errors}, policy_check, policies, results, zero_object_rules, facets}. policies is the snapshot, each policy with its verdict {status, findings, blocking, objects_checked}; each result carries its finding count (findings); zero_object_rules lists {policy_key, rule_id} for the rules with no_objects (or older pass with checked: 0); facets {policy, severity, kind, object: {items, total}, tag, object_tags_from} count the findings by each, split into blocking and advisory. policy_check is the verdict a Run checks run kept, with blocking_total in place of blocking_finding_ids, and null for other runs." },
|
|
109
|
+
response: { type: "object", description: "{id, created_at, updated_at, trigger, actor, started_at, finished_at, status, objects_checked, branch, counts: {findings, blocking, advisory, errors}, policy_check, policies, results, zero_object_rules, facets}. policies is the snapshot, each policy with its verdict {status, findings, blocking, objects_checked, errors}, errors counting its rules that could not run; each result carries its finding count (findings); zero_object_rules lists {policy_key, rule_id} for the rules with no_objects (or older pass with checked: 0); facets {policy, severity, kind, object: {items, total}, tag, object_tags_from} count the findings by each, split into blocking and advisory. policy_check is the verdict a Run checks run kept, with blocking_total in place of blocking_finding_ids, and null for other runs." },
|
|
105
110
|
},
|
|
106
111
|
{
|
|
107
112
|
method: "GET", path: prefix + "/run/{run_id}/findings", description: "Read one page of a retained run's findings, in the platform's order, filtered and searched on the instance. A list filter matches a finding when any of its values does, and a page holds the findings that match every filter given. Send a list with indexed keys: policy[0]=A&policy[1]=B.",
|
|
@@ -127,7 +132,7 @@ An evaluation stores a run and its findings; it does not modify the policy. Find
|
|
|
127
132
|
},
|
|
128
133
|
{
|
|
129
134
|
method: "GET", path: "/workspace/{workspace_id}/agent-skills",
|
|
130
|
-
description: "Serve the generated xano-policies agent skill. One generator, three surfaces: studio (the default, the variant the Studio agent loads), cli (the variant xano skills pull writes) and mcp (the variant the authenticated MCP's xano_get_policy_skill serves). With digest=true and surface studio or mcp it also answers xano-active-policies, a budgeted digest of the branch's active policies (
|
|
135
|
+
description: "Serve the generated xano-policies agent skill. One generator, three surfaces: studio (the default, the variant the Studio agent loads), cli (the variant xano skills pull writes) and mcp (the variant the authenticated MCP's xano_get_policy_skill serves). With digest=true and surface studio or mcp it also answers xano-active-policies, a budgeted digest of the branch's active policies (blocking first, one line per rule) when the branch has one. Each surface has its own description. The check catalogue inside it is generated from the live registry at request time, so it can never document a check this instance does not have. A workspace knowledge record named xano-policies replaces the platform skill and is served instead. Needs the workspace:policy permission at read level, like the other policy routes.",
|
|
131
136
|
parameters: [workspace, branch, { name: "surface", type: "string", in: "query", default: "studio", enum: ["studio", "cli", "mcp"], description: "Which variant of the generated skill to return" }, { name: "digest", type: "boolean", in: "query", default: false, description: "Also answer the xano-active-policies digest item" }],
|
|
132
137
|
response: { type: "object", description: "{knowledge: [...]}: the same envelope as workspace knowledge, with one item named xano-policies whose knowledge_type is skill and whose content is the skill markdown. The platform's own item has id -101." },
|
|
133
138
|
},
|
|
@@ -122,7 +122,7 @@ POST /workspace/1/agent
|
|
|
122
122
|
steps: [
|
|
123
123
|
"1. `POST /workspace/{id}/request_history/search` - Search for failed requests",
|
|
124
124
|
"2. Filter by status: [400, 401, 403, 404, 500]",
|
|
125
|
-
"3. Use
|
|
125
|
+
"3. Use include_output=true to see each request's output (the input is always returned)",
|
|
126
126
|
"4. `GET /workspace/{id}/apigroup/{id}/api/{id}?include_xanoscript=true` - Review endpoint code"
|
|
127
127
|
]
|
|
128
128
|
}
|
package/dist/xanoscript.js
CHANGED
|
@@ -341,7 +341,7 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
341
341
|
`- file_path='api/users/create.xs' — auto-select the docs for the file you're editing`,
|
|
342
342
|
`- filter='round' — one expression filter's signature and example (comma-separate for several, e.g. filter='to_upper,split')`,
|
|
343
343
|
`- tier='survival' (~${tiers.survival.tokens}) or tier='working' (~${tiers.working.tokens}) for context-limited models`,
|
|
344
|
-
`- topic='policies' — when the workspace has a policies/ folder: keep to its active
|
|
344
|
+
`- topic='policies' — when the workspace has a policies/ folder: keep to its active blocking policies while changing code, and evaluate after`,
|
|
345
345
|
`- mode='quick_reference' — compact output when you only need a reminder`,
|
|
346
346
|
`- max_tokens=4000 with file_path= — stop loading once the budget is reached`,
|
|
347
347
|
`- exclude_topics=['syntax'] with file_path= — skip topics you've already loaded`,
|
|
@@ -269,7 +269,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
269
269
|
| `workspace` | Workspace-level settings: environment variables, preferences, realtime | Env Variables, Preferences |
|
|
270
270
|
| `branch` | Branch-level settings: middleware, history retention, visual styling | Middleware Config, History |
|
|
271
271
|
| `middleware` | Request/response interceptors for functions, queries, tasks, and tools | Pre/Post Hooks |
|
|
272
|
-
| `policies` | Workspace policy documents: syntax, check catalogue,
|
|
272
|
+
| `policies` | Workspace policy documents: syntax, check catalogue, templates, authoring rules | Quick Reference, Permissions |
|
|
273
273
|
|
|
274
274
|
### Development
|
|
275
275
|
|
|
@@ -29,7 +29,7 @@ line 3: policy files cannot contain "//" comments. Put the explanation in the po
|
|
|
29
29
|
|
|
30
30
|
with `"/* */"` in place of `"//"` for a block comment. For a trailing comment — `severity = "high" // critical | high` — the message names that line and the position points at the comment, not at the value. `#` is a plain syntax error: `Syntax error: unexpected '#'`. Never annotate policy source; put the explanation in `statement`, `rationale`, `narrative` or a rule's `title`.
|
|
31
31
|
|
|
32
|
-
`enforcement` decides what a finding does.
|
|
32
|
+
`enforcement` decides what a finding does. An active `blocking` policy's findings block: they refuse a merge, a set-live, a publish or push to the live branch, and a tenant deploy of a release that has them (see Gates). `advisory` findings are reported and block nothing, and a policy save itself is never gated. An inactive policy (`active = false`) is never evaluated by a branch run; an active one is. **Write a new policy `active = true` with `enforcement = "advisory"`**, the pair a policy that omits both lines gets. It blocks nothing while its findings are reviewed, and, unlike an inactive policy, it is actually evaluated, so the author can see what it reports. Use `active = false` only to park a policy you do not want evaluated at all. Policies can also include `rationale`, `narrative` and `tags`. There is no `owner` field: canonical source never writes one, and every authored path — source parse, dashboard save, Metadata API save and `workspace push` — refuses an `owner` line or key with `policy: "owner" was removed; delete the line. Ownership will return as a reference to a workspace member.` (on the source path the refusal also carries the line and column). There is no `remediation` field either, on a policy or on a rule: it is refused with `policy: "remediation" was removed; put the guidance in the policy statement.` (on a rule the sentence is prefixed by the rule's position instead of `policy:`). Long text such as `narrative` can use a `"""` triple-quoted multiline string. `tags` is a list of strings, for example `tags = ["soc2", "hipaa"]`, the same syntax as tags on any other workspace object; there is no separate framework/mapping concept, a tag is simply how a customer labels a framework.
|
|
33
33
|
|
|
34
34
|
`severity` says how much a violation of this policy matters. It orders findings in reports, and it never blocks a gate — enforcement does. Its four values are `critical`, `high`, `medium` and `low`; nothing else is accepted. It defaults to `medium`, and canonical source omits the line at that default. `active` and `enforcement` are always written, because they are what decide whether a policy blocks.
|
|
35
35
|
|
|
@@ -46,20 +46,22 @@ Each rule selects a built-in check and supplies literal parameters:
|
|
|
46
46
|
## Authoring workflow
|
|
47
47
|
|
|
48
48
|
1. Read the branch's existing policies and the instance's check catalogue. The catalogue is the only source of truth for what each check reports, which object kinds it inspects and the exact parameters it accepts.
|
|
49
|
-
2. Write one `policy KEY { ... }` document in `policies/KEY.xs`, from scratch or from a
|
|
49
|
+
2. Write one `policy KEY { ... }` document in `policies/KEY.xs`, from scratch or from a template (below). Customize its key, statement and rules. The file name is the key: Studio refuses to publish a policy file named otherwise (`This file declares policy KEY, and a policy file is named after its key: rename it to /policies/KEY.xs.`). Change a key only when the user asks, renaming the file to the new key with it; never move a policy to a file named anything else.
|
|
50
50
|
3. Validate and format through the native `POST /api:meta/workspace/{id}/policy/parse` endpoint with `{source}` (and `branch`, to be warned against that branch). The result contains `{policy, source, rule_warnings}` and writes nothing; `rule_warnings` lists each rule that would do nothing or allow too much there. Read them before saving. With the authenticated Xano MCP, use its policy parse tool. The developer MCP's `xano_validate_xanoscript` checks a policy file locally first: syntax and block-shape problems (comments, a named rule, a field set twice, a non-literal parameter) are errors, and what the check catalogue decides (an unknown check, field or parameter, a value outside its set, a removed field) is a warning, checked against the catalogue the language server ships with, which can be older than your instance. A local pass is a preview; the instance's parse decides.
|
|
51
|
-
4. Save canonical source using `POST /policy` (create) or `PUT /policy/{id}` (update) with `{branch, data: {source}}`. Do not combine source with structured fields. **To change an existing policy, update it by its id** — read the id from the policy list (`xano_list_policies`, `xano policy list -o json`), take the `source` a read returns, edit it, and send it to `PUT /policy/{id}` (the authenticated MCP's save tool with `policy_id`). This is also how an inactive policy becomes active: the same policy id, with `active = true` in the source. A `POST` whose key already exists is refused, naming the policy that holds it — `A policy with key "AUTH-001" already exists on this branch (policy id 12, "Authentication baseline"). To change it, update policy id 12 instead of creating a new one.` — and a `PUT` whose source carries another policy's key says which id is which. A create whose rules exactly match a live policy on the branch is refused too, with HTTP 400 `payload.code` `policy_duplicate`: `A policy with exactly these rules already exists: KEY. Change a parameter or scope to add another.`, and `existing_key`, `existing_id` and `policies` (each copy as `{key, existing_key, existing_id}`). The rules are compared as a set of checks with their normalized params (scope fields are params); the key, title, statement, severity, enforcement, `active`, tags and rule titles are ignored. Only a create is refused, never an update, and a push refuses its copies before anything is imported. The `source` a read returns is canonical, so it is safe to send back unchanged (a no-op) or edited. Add an optional `message` (and `description`) to label the Version History entry the save creates. The server owns versioning: see below.
|
|
52
|
-
5. Evaluate the same branch and read its verdict and findings. A run is evidence only for the definitions it checked: every policy a read serves carries `latest_run`, the platform's answer to whether the branch's newest run still describes it (`stale: true` once the policy changed after that run, `included: false` when the run did not evaluate it). A run snapshots the policies it checked: each policy's `statement` as written at run time and, per rule, its display `label` and the resolved `params` the check actually ran with (values that resolved to nothing are omitted, and an empty map serializes as `[]`). `xano policy status --run-detail` prints them. A run can hold tens of thousands of findings, so read a large one in parts: its summary (counts, each policy's verdict, each rule's finding count) and its findings a page at a time, filtered by blocking, policy, rule, severity, object kind, object, tag or text (`GET …/policy/run/{run_id}/summary` and `…/findings`; `xano policy runs <id>` with `--offset`, `--limit` and filter flags; the authenticated MCP's run tool). An evaluation can answer that summary with its first 50 findings (`answer: "summary"`, `xano policy evaluate --summary`, and the MCP evaluate tool, which always asks for it), and the `policy_check` a push answers lists the first 100 findings beside `counts`, `total` and `truncated`: the stored run (`run_id`) has them all.
|
|
51
|
+
4. Save canonical source using `POST /policy` (create) or `PUT /policy/{id}` (update) with `{branch, data: {source}}`. Do not combine source with structured fields. **To change an existing policy, update it by its id** — read the id from the policy list (`xano_list_policies`, `xano policy list -o json`), take the `source` a read returns, edit it, and send it to `PUT /policy/{id}` (the authenticated MCP's save tool with `policy_id`). This is also how an inactive policy becomes active: the same policy id, with `active = true` in the source. A `POST` whose key already exists is refused, naming the policy that holds it — `A policy with key "AUTH-001" already exists on this branch (policy id 12, "Authentication baseline"). To change it, update policy id 12 instead of creating a new one.` — and a `PUT` whose source carries another policy's key says which id is which. Both are HTTP 400 with `payload.code` `policy_key_taken`, `key` (the key sent), `existing_key` (the holder's, which differs only in case when the sent key does) and `existing_id` (null when a concurrent create took the key first); branch on the code, not the sentence. A create whose rules exactly match a live policy on the branch is refused too, with HTTP 400 `payload.code` `policy_duplicate`: `A policy with exactly these rules already exists: KEY. Change a parameter or scope to add another.`, and `existing_key`, `existing_id` and `policies` (each copy as `{key, existing_key, existing_id}`). The rules are compared as a set of checks with their normalized params (scope fields are params); the key, title, statement, severity, enforcement, `active`, tags and rule titles are ignored. Only a create is refused, never an update, and a push refuses its copies before anything is imported. The `source` a read returns is canonical, so it is safe to send back unchanged (a no-op) or edited. Add an optional `message` (and `description`) to label the Version History entry the save creates. The server owns versioning: see below.
|
|
52
|
+
5. Evaluate the same branch and read its verdict and findings. A run is evidence only for the definitions it checked: every policy a read serves carries `latest_run`, the platform's answer to whether the branch's newest run still describes it (`stale: true` once the policy changed after that run, `included: false` when the run did not evaluate it). A run snapshots the policies it checked: each policy's `statement` as written at run time and, per rule, its display `label` and the resolved `params` the check actually ran with (values that resolved to nothing are omitted, and an empty map serializes as `[]`). `xano policy status --run-detail` prints them. A run can hold tens of thousands of findings, so read a large one in parts: its summary (counts, each policy's verdict, each rule's finding count) and its findings a page at a time, filtered by blocking, policy, rule, severity, object kind, object, tag or text (`GET …/policy/run/{run_id}/summary` and `…/findings`; `xano policy runs <id>` with `--offset`, `--limit` and filter flags; the authenticated MCP's run tool). An evaluation can answer that summary with its first 50 findings (`answer: "summary"`, `xano policy evaluate --summary`, and the MCP evaluate tool, which always asks for it), and the `policy_check` a push answers lists the first 100 findings beside `counts`, `total` and `truncated`: the stored run (`run_id`) has them all. A pusher without `workspace:policy` read is evaluated the same way (the run is stored) but told only their own findings on the objects the push carried (see Permissions).
|
|
53
53
|
|
|
54
54
|
Policies also travel in the platform's workspace multidoc import/export. Use the official CLI's `workspace pull` and `workspace push` flow for a local workspace (the CLI `workspace` topic covers `push -m`). The authenticated MCP supports workspace exports and one-time upload URLs for large multidocs; upload processes the source on the instance. On a branch that is not live, a blocking finding reported after a push does not roll back that import; a push to the live branch is gated before it commits (see Gates).
|
|
55
55
|
|
|
56
56
|
Inside Xano's own agent, the instance serves a platform skill named `xano-policies`, generated from the live check catalogue: this file format, every check id and its parameters, and the authoring rules. A coding agent installs the terminal variant of the same skill with `xano skills pull` (see the CLI `skills` topic).
|
|
57
57
|
|
|
58
|
-
## Starting from a
|
|
58
|
+
## Starting from a template
|
|
59
59
|
|
|
60
|
-
The check catalogue response (`GET /api:meta/workspace/{id}/policy/check`) also carries `
|
|
60
|
+
The check catalogue response (`GET /api:meta/workspace/{id}/policy/check`) also carries `templates`: the platform's list of starting points for a policy, such as "Endpoints require login". Each template holds what a policy needs to be created from it: `id`, `category` (the id of the group it is filed under; the response's `template_categories` lists the groups in the order to offer them, each as `{id, label}`: `access_control` Access control, `data_protection` Data protection, `secrets` Secrets, `integrations` Integrations, `reliability` Reliability, `testing` Testing; groups cut across object kinds and are not compliance frameworks), `title` (the new policy's `title`), `summary` (its `statement`), a suggested `key`, the policy `severity`, search `keywords`, a one-sentence `limits` note on what its rules cannot see, and `rules[]` of `{title, check, params, needs, needs_any}`. `params` are sparse, and `needs` names the parameter paths the author must fill; a need is never seeded. Every `needs` path is required unless the rule says `needs_any: true`, when one filled path is enough (the vendor allowlist takes hosts, providers or both); `needs_any` is false on every other rule.
|
|
61
61
|
|
|
62
|
-
In the dashboard, **
|
|
62
|
+
In the dashboard, **Create Policy** opens the templates (**Start from scratch** is in its ▾ menu), grouped by category, with a search over each template's title, summary, category and keywords and over its rules' titles and their checks' ids, labels, keywords and first description sentence. **Choose** on a template opens the create form with its title, statement, key, severity and rules filled in, leaving only the `needs` to fill; nothing is saved or run until the author saves, and that first save starts Run Checks, unless the policy is inactive, a run is already in flight or the author may not run checks. The same form edits a policy after creation (**Edit Policy**). In the form a rule is edited in place: a row click, **Clone** or **Add Rule** opens the rule view in the same panel ("← Back to <policy>", **Cancel** / **Apply**); **Apply** puts the rule into the form, and only the form's **Save** stores the policy. On the policy page, a Rules row click, **Edit Rule**, **Clone Rule** and **Add Rule** open the rule panel directly, and its **Save** stores the policy; **Delete Rule** confirms, then saves the policy directly. A clone is named with the lowest free number ("Require auth 2"), and a rule's name is a field in its form. Every save is the ordinary whole-policy save. A template can be used more than once: a key the branch already uses gets a `-2`, `-3`… suffix, and a copy whose rules exactly match a policy the branch has is refused (`policy_duplicate`, see Authoring workflow) until a parameter or scope changes. **Add Rule** searches the checks. To author from a template yourself, find the matching one, copy its rules into `policies/KEY.xs`, fill every `needs` path (at least one of them for a `needs_any` rule) from the check's catalogue schema, and parse; with the CLI, `xano policy create --template <id>` does the same. A policy created from a template is ordinary: active and advisory, with no record of the template.
|
|
63
|
+
|
|
64
|
+
Each template also carries `frameworks`: framework tag ids, possibly none, from the response's `template_frameworks` (`[{id, label}]`, in the order to offer them: `soc2` SOC 2, `hipaa` HIPAA, `gdpr` GDPR). A tag marks a template on a topic that framework also covers (access control, audit logging, sensitive or personal data, secrets, data in transit, vendors, change testing). It is a second way to find templates, not a mapping to a framework's criteria: a tag never means that the template, or a policy made from it, makes a workspace compliant, and Xano does not track changes to the frameworks. The response's `template_frameworks_note` is the platform's sentence saying so; show it wherever the tags appear. The dashboard's template search also matches each tag's id and label, and `xano policy catalogue` ends each template row with its tags in brackets. A policy created from a tagged template carries no framework tag. To label a policy with a framework, add the tag to its `tags` yourself (`tags = ["soc2"]`), and never say the policy satisfies the framework.
|
|
63
65
|
|
|
64
66
|
## Versioning
|
|
65
67
|
|
|
@@ -75,15 +77,15 @@ Policies version exactly like every other Xano object: one Version History entry
|
|
|
75
77
|
|
|
76
78
|
## Gates
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
Blocking policies gate changes, not saves. One rule decides every branch gate (the tenant deploy gate judges a release on its own; see Releases and tenants):
|
|
79
81
|
|
|
80
|
-
- **Which policies decide:** the active
|
|
81
|
-
- **Weakening a
|
|
82
|
-
- **Deleting a
|
|
82
|
+
- **Which policies decide:** the active blocking policies the branch will have after the change: its policies with the change's own selected policy changes applied (a new policy added, an updated one replaced, a deleted one removed). A merge counts the policies it carries (`select.policy`), a push to the live branch its policy files, and a set-live the candidate branch's policies, which are what live will have (a branch that landed no policy, such as one an `import-schema` created, is judged by the live branch's policies instead). So a merge that relaxes a policy (an exemption, a narrowed scope) and adds an object relying on it passes, and a merge that adds a blocking policy and an object violating it is refused. The branch before the change is judged by the same policies, so a new policy's findings on objects the change leaves alone are existing debt. A change that leaves the branch with no active blocking policy is never evaluated by a gate; one that adds the branch's first is. An archive import with `mode=merge` counts none of the archive's policies: the branch's policies before the import decide, and policies the archive writes take effect once it has landed.
|
|
83
|
+
- **Weakening a blocking policy:** a merge, push or set-live that weakens a policy that is active and blocking on the branch before the change (demotes, deactivates or deletes it, removes a rule, narrows a scope, adds an exemption or loosens a parameter) needs `workspace:policy` **update**, from a session that may write, as an override does. For a set-live, a live blocking policy the candidate branch lacks counts as deleted, unless the candidate landed no policy at all, which is not checked for weakening. If the set-live check cannot read the policies it fails closed: only a caller with update proceeds, and anyone else is refused with the same code, `unavailable: true`, no policies named and `Set live refused: whether it weakens a blocking policy could not be checked, and weakening one needs the workspace:policy update permission. The live branch was not changed.` Otherwise the change is refused before anything is written: HTTP 403 with `payload.code` `policy_weakening_permission_required`, `gate`, `permission` (`workspace:policy`), `level` (`update`) and `policies` (the keys), and the message `<Gate> refused: it weakens blocking policy KEY, which needs the workspace:policy update permission. <outcome>`, for example `Push refused: it weakens blocking policy GATE-001, which needs the workspace:policy update permission. Nothing was imported.` (a merge ends `Leave the policies out of the merge to merge the rest.`, a set-live `The live branch was not changed.`). A caller who holds update in a session that may not write reads `… permission from a session that may write.` A release deploy with set live adds what landed first (`The release was deployed as branch "<label>". `) and names it in `payload.branch`. `override_reason` does not lift it. The merge dry run and its policy plan report it without refusing, as `weakening {policies, permission, level, allowed}`; the push dry run refuses the same way. A set-live that goes through with such a weakening writes a `policy_run:set_live_weakened` audit row naming the policies and how each was weakened.
|
|
84
|
+
- **Deleting a blocking policy** needs `workspace:policy` **update** as well as delete, on every branch: `Delete refused: it weakens blocking policy GATE-001, which needs the workspace:policy update permission.` (`payload.gate` `delete`). Deleting an advisory or inactive policy needs only delete. An archive import that deletes existing policies (`mode=replace`, or `mode=merge` with `delete=true`) is refused the same way when it would remove an active blocking policy of the branch it writes that the archive does not bring back: `Archive import refused: it weakens blocking policy GATE-001, which needs the workspace:policy update permission. Nothing was imported.` Because a carried policy change counts, editing a policy is never part of a fix (see Fixing a finding).
|
|
83
85
|
- **What blocks:** blocking findings the change **introduces**, and blocking findings on objects whose definition it **changes**. Findings already on unchanged objects are existing debt: reported as `existing`, never blocking.
|
|
84
|
-
- **Refusal:** HTTP 403 with `payload.code` `policy_gate`, the message `<Gate> refused: N blocking policy finding(s) (X introduced by this change, Y on objects it changes)
|
|
86
|
+
- **Refusal:** HTTP 403 with `payload.code` `policy_gate`, the message `<Gate> refused: N blocking policy finding(s) from KEY (X introduced by this change, Y on objects it changes).` (it names the policies the blocking findings come from, the first three, then `and M more`, to every caller, policy read or not), and `{gate, status, total, introduced, changed, existing, run_id, can_override, sources, findings, truncated}`; `findings` (the first 100) only for a caller with `workspace:policy` read. Every gate answer (a merge's and its dry run's `policy_gate`, the merge review, set-live, the tenant deploy gate, a refusal's payload) carries `sources`, the same list as the message (`from AUTH-010 and PII-001`), to every caller whenever its blocking findings name a policy. Nothing is written.
|
|
85
87
|
- **Override:** a caller holding `workspace:policy` **update** may proceed by giving a reason (`override_reason`), which writes a `policy_run:override` audit row. Never override on a user's behalf unless they gave you the reason.
|
|
86
|
-
- An engine fault fails open (`unavailable`); a permission failure is a refusal.
|
|
88
|
+
- An engine fault fails open (`unavailable`); a permission failure is a refusal. A rule that cannot run on an active blocking policy makes the branch gates `unavailable`, and the change goes through ungated until every rule can run; a rule error on an advisory or inactive policy changes no branch gate.
|
|
87
89
|
|
|
88
90
|
| Gate | When | How to override |
|
|
89
91
|
| --- | --- | --- |
|
|
@@ -94,7 +96,7 @@ Mandatory policies gate changes, not saves. One rule decides every branch gate (
|
|
|
94
96
|
| Push | A non-draft `workspace push` to the live branch; it needs its transaction (`policy_gate_transaction_required` otherwise) | `override_reason` on the multidoc and upload routes; `xano workspace push --policy-override "<reason>"` |
|
|
95
97
|
| Tenant deploy | Deploying a release to a standard or run tenant: any blocking finding in the release's own check refuses it, existing debt included (see Releases and tenants) | `override_policy` with the reason |
|
|
96
98
|
|
|
97
|
-
A push to a branch that is not live is not gated: it imports, then answers `policy_check`, and a blocking finding does not roll it back. Tables, API groups, environment variables, workspace and branch settings, realtime servers, and MCP prompts and resources are saved without the publish gate, although a check may read one (a realtime server's middleware): a
|
|
99
|
+
A push to a branch that is not live is not gated: it imports, then answers `policy_check`, and a blocking finding does not roll it back. Tables, API groups, environment variables, workspace and branch settings, realtime servers, and MCP prompts and resources are saved without the publish gate, although a check may read one (a realtime server's middleware): a blocking policy never refuses those saves, on the live branch too. The next run reports what they break, and a set-live or tenant deploy that carries it is gated. No check reads an MCP prompt or resource; adding one to an MCP server or removing it changes the server, so that save is gated.
|
|
98
100
|
|
|
99
101
|
## Plan limits
|
|
100
102
|
|
|
@@ -104,8 +106,8 @@ Lower plans cap the policies on each branch, active or not; Pro and above are un
|
|
|
104
106
|
|
|
105
107
|
Policies travel where the code travels while the instance's `policies` feature is on:
|
|
106
108
|
|
|
107
|
-
- A **branch merge** carries policies like other objects: added, changed and deleted. A merge that changes a policy needs `workspace:policy` create, update or delete for what it changes and obeys the plan cap; the carried policies count toward the merge's own gate (see Gates), and the merge review lists each one with its diff and calls out weakening.
|
|
108
|
-
- A **release** carries its branch's policies (inactive ones included) and records a policy check when it is cut (`GET /workspace/{id}/release/{release_id}/policy_run`, `xano policy runs --release <name>`). A release built from files by `release push` carries its policy files only for a caller holding `workspace:policy` create and update; for anyone else it carries the workspace's live-branch policies instead (see Permissions). **Deploying** a release makes the tenant's policies exactly the release's, and is gated by the release alone: the blocking findings of the release's own policy check (the one stored when it was cut, or checked from its archive on demand) refuse the deploy unless overridden, existing debt included. The gate does not compare the release with what the tenant runs, so the same release gets the same verdict on every tenant. Its answer is `{gate, status, total, run_id, can_override, gated, release {id, name, run_id, status, counts, carried}, message, findings, truncated}` (`GET /workspace/{id}/tenant/{tenant_name}/policy_gate?release_name=`, `xano tenant deploy_release --check`). Ephemeral and sandbox tenants get the verdict (`gated: false`) and are never refused, and a release cut before releases carried policies is `not_carried` and not gated. Deploying a release into a workspace as a new branch lands its policies there.
|
|
109
|
+
- A **branch merge** carries policies like other objects: added, changed and deleted. A merge that changes a policy needs `workspace:policy` create, update or delete for what it changes and obeys the plan cap; the carried policies count toward the merge's own gate (see Gates), and the merge review lists each one with its diff and calls out weakening. With the feature on, the merge review (Studio's dry run of the merge) gives a member without `workspace:policy` read the gate's verdict trimmed instead: the counts and `sources` for every blocking finding, their own blocking findings on objects they may read (trimmed, first 100, `access: "coverage"`; a trigger by its `obj_type` as the dry run left it, one that cannot be resolved needing every trigger scope; each with the check and fix hint of the policies the merge leaves) and a fixed `note`, never the policy plan, with a merge error about policies read as one fixed sentence (a key clash, or a target policy changed meanwhile, keeps its own sentence, which names only keys); the merge itself is gated for them as for anyone. Such a member may ask for 20 merge reviews a minute in a workspace; past that the review is refused with 429 `policy_merge_review_rate_limited` and `retry_after`, before anything is exported, and Studio says `Too many merge reviews in the last minute, so the policy check wasn’t previewed. Check again in a moment.` without holding Merge. A reader's review is not limited.
|
|
110
|
+
- A **release** carries its branch's policies (inactive ones included) and records a policy check when it is cut (`GET /workspace/{id}/release/{release_id}/policy_run`, `xano policy runs --release <name>`). A release built from files by `release push` carries its policy files only for a caller holding `workspace:policy` create and update; for anyone else it carries the workspace's live-branch policies instead (see Permissions). **Deploying** a release makes the tenant's policies exactly the release's, and is gated by the release alone: the blocking findings of the release's own policy check (the one stored when it was cut, or checked from its archive on demand) refuse the deploy unless overridden, existing debt included. A rule that could not run does not lift that refusal; a release with no blocking finding whose check has a rule that could not run (on any policy) is `unavailable`, and the deploy is not gated. The gate does not compare the release with what the tenant runs, so the same release gets the same verdict on every tenant. Its answer is `{gate, status, total, run_id, can_override, sources?, gated, release {id, name, run_id, status, counts, carried}, message, findings, truncated}` (`GET /workspace/{id}/tenant/{tenant_name}/policy_gate?release_name=`, `xano tenant deploy_release --check`); `findings` and `truncated` go only to a caller with `workspace:policy` read, while the `message` names the blocking policies to everyone (`Deploy blocked: this release has 1 blocking policy finding from AUTH-001.`). Both preview routes need `workspace:policy` read, so only a reader calls them. A blocked deploy's refusal (the deploy and approve routes) tells a caller without policy read the counts, `sources` and the sentence naming the policies, never the findings. An approval request's stored `deploy_error` is that refusal's own sentence, with the policies named (and the override-denied suffix when it applies); no finding is stored. Ephemeral and sandbox tenants get the verdict (`gated: false`) and are never refused, and a release cut before releases carried policies is `not_carried` and not gated. Deploying a release into a workspace as a new branch lands its policies there.
|
|
109
111
|
- A **tier1 tenant, ephemeral or sandbox push** and its dry run carry policy documents without authoring permission or plan cap. A remote tenant push, and a push to a tenant created before policies (it has no policy table until its next platform update), still leave them out and name them once in `policies_skipped` (`{message, keys}`), whose message says why.
|
|
110
112
|
- A backup restore, a workspace archive and a branch clone carry every policy on the branch (inactive policies included) with its `guid` and `version`; runs and Version History do not travel. Those copies keep the fields the receiving platform knows and drop the rest, and a policy that still cannot be read (for example a check an older platform does not have) is skipped with a `policy:import_skipped` warning in the audit log, naming the policy and the reason, while everything else imports. Authored writes (Metadata API, Studio, `workspace push`) stay strict.
|
|
111
113
|
|
|
@@ -120,34 +122,34 @@ Every entry carries a human `label` beside its id; that label is what names a ru
|
|
|
120
122
|
<!-- BEGIN GENERATED: checks -->
|
|
121
123
|
| Check | Label | Behavior | Parameters |
|
|
122
124
|
| --- | --- | --- | --- |
|
|
123
|
-
| `db.output_fields_forbidden` | Statements do not fetch listed fields | Reports db.query, db.get, db.add, db.edit, db.patch and db.add_or_edit statements
|
|
124
|
-
| `db.where_constraint_required` | Reads and writes constrain a required field | Requires
|
|
125
|
-
| `db.write_from_input_forbidden` | Writes don't take protected fields from input | Reports
|
|
126
|
-
| `literal.credential_shape` | Definitions avoid recognizable credential literals | Reports credential-shaped literals and literal keys in the selected locations. Findings name locations and pattern ids, never values. The definition location scans everything authored in each object (stack, inputs and defaults, response, settings, tests, descriptions), disabled content included since it is still stored and exported; env and agent settings are separate locations. Documentation examples (AWS keys ending EXAMPLE, the jwt.io sample token) are skipped. aws and twilio match identifiers rather than secrets, and some Google browser keys are public by design, though a backend literal still belongs in env. literal_keys reports literal keys and IVs passed to security.encrypt/decrypt, jws/jwe encode/decode and hmac_* filters, and literal bearer tokens passed to ai.external.mcp statements; public keys (PEM PUBLIC KEY/CERTIFICATE, JWKs without private members) are allowed. Each finding names the SHA-256 fingerprint of every value it reports, and a value whose fingerprint allowed_secrets lists is skipped. | `patterns`, `locations`, `allowed_secrets` |
|
|
127
|
-
| `object.auth_required` | Endpoints require authentication | Requires each endpoint and realtime message handler in scope to
|
|
128
|
-
| `object.input_rules` | Endpoint, tool and message inputs declare types, filters and bounds | Checks
|
|
129
|
-
| `object.middleware_required` | Objects attach required middleware | Requires each named middleware to be attached and active
|
|
130
|
-
| `object.settings_forbidden` | Objects avoid forbidden settings | Reports objects whose settings match all configured predicates. Name settings from the kind's list. Raw storage paths are accepted, but a path found on no object makes the rule inert, with a warning; a workspace, agent or MCP server row holds secrets, so on those kinds only listed settings are matched. A listed setting compares its effective value: the stored value, else its default. present and absent test whether it is stored explicitly, and a raw path is always read as stored. Numeric predicates match only a numeric value, including a numeric string; in does not match a missing setting and not_in does, like not_equals. To bound a value use gt, e.g. cache.ttl gt 3600 reports a TTL above an hour; requiring a setting to exist needs a second rule with absent: true. A setting holding a secret (a key, token, password or credential) cannot be matched. | `object_kind*`, `when*` |
|
|
131
|
-
| `object.statement_required` | Objects call a required function or statement | Requires a
|
|
132
|
-
| `object.tagged_table_access` | Objects reaching tagged tables declare auth and an audit call | Requires
|
|
125
|
+
| `db.output_fields_forbidden` | Statements do not fetch listed fields | Reports database reads and writes that fetch a listed field, or a field marked sensitive, from their table. It reads the output list of db.query, db.get, db.add, db.edit, db.patch and db.add_or_edit statements. Judges what each statement fetches into the object's stack, not the final response, so a field fetched but never returned is still reported. Sensitive means marked sensitive in the schema or password-typed; a password field is not reported when the record is used only through its other fields, a null check, or security.check_password, and returning or copying the whole record is reported. An absent or default output fetches every field, and an object or list field without narrowed children fetches every field inside it. Every nesting depth of the stack is inspected, and a dotted entry reaches inside a paged result (items.email). A field is only forbidden on a table that has it, and an output entry is attributed only through the statement's own declarations: a field of its own table, its own or a declared join alias as a prefix (user.email), or a literal eval alias; table.field restricts a name to that table. An entry whose provenance cannot be resolved (a runtime value, a computed eval, an undeclared prefix) is not reported, count, exists and aggregate queries fetch no record, and db.direct_query is not checked. Addons attached to the object's statements, and to statements in functions it calls, are always inspected against the addon's own table, narrowed by the attaching statement's selection. A function the object calls is followed, whatever the rule's scope, and what it fetches is reported on the caller; fixing the function clears every caller, and exempting a function with except_tags also exempts what callers reach through it. Middleware and tool mappings are not followed: each is judged as its own object. Exemption is per object: an exempted object is exempt for every listed field. | 1 of (`fields`, `include_sensitive`), `table_tags` |
|
|
126
|
+
| `db.where_constraint_required` | Reads and writes constrain a required field | Requires every read and write of the selected tables to filter on a chosen field, such as the owner, optionally against a value such as the logged-in user. The rule constrains field, against compare_to when set. Scope picks the objects inspected; table_selector picks which of their reads and writes are judged, empty meaning every table that has field. A db.query, db.get, db.bulk.delete or db.increment is judged by its where: a predicate counts only with =, in, contains or overlaps, on the statement's own table (a bare field or its own alias, not a joined one), and it must hold on every OR branch. An optional predicate (==?, in? …) is skipped at run time when its value is empty, so it never satisfies this rule. A selected table read as the primary table covers its joins; a selected table joined into an unselected one needs its own predicate, in the where or in its join condition. db.edit, db.patch, db.del and db.add_or_edit pass when they pick their row by field against compare_to, or by id = $o.id where $o is an earlier constrained read of the same table, or a foreach item over one, assigned nowhere else. The trace does not cross function calls, so a helper function writing by a passed-in id is reported (move the constrained read into it, or exempt it), and so is a write by $input.id after a precondition on the owner (write by $o.id instead). db.truncate on a selected table is always reported. Not checked: db.has (existence only), db.add (pin the owner with db.write_from_input_forbidden), db.bulk.patch, db.bulk.update and db.direct_query. To check only order's reads and writes, use table_selector: { names: ["order"] }; scope tables only picks which objects are inspected. | `table_selector`, `field*`, `compare_to` |
|
|
127
|
+
| `db.write_from_input_forbidden` | Writes don't take protected fields from input | Reports database writes that take a whole record, or a protected field such as a role, straight from request input. Input is traced through variables, loops and data transforms. A write whose data is taken whole from input ($input or any $input.x) is mass assignment: whitelist the keys with pick, or build the object field by field. A pick as the last filter, with a literal key list, assigns exactly the picked keys; unset, unpick and set do not narrow the data. A record held in a variable assigned once (var, never changed after) is judged as the value assigned, and a function writing an argument whole is judged on what each caller passes, so a pick or an object literal there narrows it. Results of database, API and function calls are not treated as input. Input means request input for endpoints and middleware, arguments for AI tools and toolset triggers, and client messages for realtime triggers and message handlers; database-trigger rows and task runs are not input. Functions are judged through their callers: a write in a function is reported on the object passing it input, whatever the rule's scope, and exempting a function with except_tags exempts what callers reach through it. Agents calling functions as tools, and api.request into the workspace, are not followed. | `statements`, `fields` |
|
|
128
|
+
| `literal.credential_shape` | Definitions avoid recognizable credential literals | Reports secrets, such as API keys, tokens and private keys, written as literal values instead of environment variables. It looks for credential-shaped literals and literal keys in the selected locations. Findings name locations and pattern ids, never values. The definition location scans everything authored in each object (stack, inputs and defaults, response, settings, tests, descriptions), disabled content included since it is still stored and exported; env and agent settings are separate locations. Documentation examples (AWS keys ending EXAMPLE, the jwt.io sample token) are skipped. aws and twilio match identifiers rather than secrets, and some Google browser keys are public by design, though a backend literal still belongs in env. literal_keys reports literal keys and IVs passed to security.encrypt/decrypt, jws/jwe encode/decode and hmac_* filters, and literal bearer tokens passed to ai.external.mcp statements; public keys (PEM PUBLIC KEY/CERTIFICATE, JWKs without private members) are allowed. Each finding names the SHA-256 fingerprint of every value it reports, and a value whose fingerprint allowed_secrets lists is skipped. | `patterns`, `locations`, `allowed_secrets` |
|
|
129
|
+
| `object.auth_required` | Endpoints require authentication | Requires each endpoint and realtime message handler in scope to require a login (an auth table); a handler naming none is reported like a public endpoint. Exclude deliberate public ones with except_tags. An endpoint also carries its API group's tags; api_groups and verbs narrow the rule to endpoints. Checks the saved authentication setting; authorization logic is not evaluated. | _scope only_ |
|
|
130
|
+
| `object.input_rules` | Endpoint, tool and message inputs declare types, filters and bounds | Checks the inputs that endpoints, AI tools and message handlers declare: their types, page-size limits, values in the URL path and unused inputs. Enable at least one condition. Each condition can be its own rule; combine them only when they share severity and scope. Tools are included because a model chooses their arguments; functions are judged through their callers and are not inspected. path_params_forbidden applies to endpoints only. Nested object inputs are checked by dotted path (address.zip), a list of objects by element path (items.zip); json inputs have no declared shape. Without input_names, filter rules apply to every text input and unused_forbidden to every top-level input; input_names narrows them to exactly the named inputs, of any type. Filters are checked as declared on the input's type: min on an int bounds the value, on text its length. For paging, per_page is traced through variables, data transforms and called functions to each input reaching it; only a literal max filter on that input counts, bounding the value in code is not recognised, and the page (offset) input is not bounded by this condition. Middleware reads raw request params (as $input.vars.<name>) before the declared inputs are parsed, so a declaration does not validate what middleware reads, and an input read only by middleware is reported as unused. Called functions and the middleware resolution chain are read whatever the rule's scope. | 1 of (`type_by_name`, `filters_required`, `paging_max_required`, `path_params_forbidden`, `unused_forbidden`, `inputs_required`, `filter_min`), `input_names` |
|
|
131
|
+
| `object.middleware_required` | Objects attach required middleware | Requires each named middleware to be attached and active on every object in scope, before or after the object runs as selected. A tool must have it on every path it is served by. Middleware is resolved as the runtime does, one phase at a time: the object's own list when it customizes, else an endpoint's API group, or a message handler's channel and then its realtime server, when that customizes, else the branch or workspace default for the object's kind. A tool is served through each toolset or MCP server that maps it and customizes middleware, and without one through the branch default; a finding names the path lacking the middleware. Reads the middleware resolution chain whatever the rule's scope. Checks presence and phase, not order, and not what the middleware does. | `middleware*`, `phase` |
|
|
132
|
+
| `object.settings_forbidden` | Objects avoid forbidden settings | Reports objects whose settings have a forbidden value, such as middleware that silently swallows exceptions. An object is reported when its settings match all configured predicates. Name settings from the kind's list. Raw storage paths are accepted, but a path found on no object makes the rule inert, with a warning; a workspace, agent or MCP server row holds secrets, so on those kinds only listed settings are matched. A listed setting compares its effective value: the stored value, else its default. present and absent test whether it is stored explicitly, and a raw path is always read as stored. Numeric predicates match only a numeric value, including a numeric string; in does not match a missing setting and not_in does, like not_equals. To bound a value use gt, e.g. cache.ttl gt 3600 reports a TTL above an hour; requiring a setting to exist needs a second rule with absent: true. A setting holding a secret (a key, token, password or credential) cannot be matched. | `object_kind*`, `when*` |
|
|
133
|
+
| `object.statement_required` | Objects call a required function or statement | Requires each object in scope to call a given function or statement, anywhere, on every path, or as its first statement. Called functions are followed; endpoints, AI tools, tasks and message handlers are inspected. A match is a listed statement that, when functions is set, calls one of them; any listed alternative satisfies the rule. Called functions are read whatever the rule's scope and except_tags: a match in one counts when the call is synchronous, no function on the way caches its result (a cached function skips its checks on cache hits), and, for unconditional, every call site on the way always runs too. A match in an attached pre-middleware counts when its exception policy is critical or rethrow, since a silent middleware swallows its failure; the middleware resolution chain is read whatever the rule's scope. In a called function or middleware, must_reference is met only by $auth and $env references. unconditional means at the top level of the stack or inside group, db.transaction, finally, or a try whose catch rethrows; not inside a conditional, switch, loop, catch or util.post_process. first means the object's own first statement, a comment skipped; a callee or middleware never counts as first. when selects objects by a statement in their own stack or in a function they call, and a read matches when.tables through the addons it attaches. | 1 of (`statements`, `functions`), `placement`, `must_reference`, `when` |
|
|
134
|
+
| `object.tagged_table_access` | Objects reaching tagged tables declare auth and an audit call | Requires every object that reaches a table carrying a sensitive-data tag to require a login and, when a function is named, to always call it, such as an audit function. The tags are table_tags. Access through called functions and addons counts. Endpoints, realtime message handlers, AI tools and tasks are inspected. Endpoints and message handlers must declare authentication, on one of auth_tables when set; a tool or task has no caller to authenticate, so only the call applies to it, and with function empty it is not examined. The call counts at the top level of the stack or inside group, db.transaction, finally, or a try whose catch rethrows; not inside a conditional, switch, loop, catch, a try whose catch swallows the failure, or util.post_process, and not when the function caches its result. Order is not required, and control flow is not followed: an early return before the call still skips it. Calls through another function do not count. Every unmet requirement is reported in one finding. Only objects reaching a tagged table count as checked. | `table_tags*`, `auth_tables`, `function` |
|
|
133
135
|
| `object.test_coverage` | Objects are covered by a test | Requires each selected endpoint, function, AI tool or task to be called by a test that then asserts something. Unit tests count for endpoints and functions. An endpoint counts when a workflow test runs api.call on it, a function function.call or function.run, an AI tool tool.call and a task task.call; middleware, added through object_kinds, counts by middleware.call or a unit test. A workflow test's workflow_test.call is followed, and so are the functions a test calls when looking for api.call. A call counts only when an expect statement follows it, in the same test or after the workflow_test.call that reached it, or when an expect.to_throw wraps it; what the assertion checks is not inspected. A unit test counts only with at least one expectation; it runs the real endpoint with its middleware but no HTTP layer, ignores token expiry, and a statement it mocks does not execute. An inactive workflow test covers nothing. Tests are read, not run, so a failing test still counts. AI tool and task unit tests cannot be run and do not count, and realtime message handlers cannot be test-covered. Reads every workflow test and unit test whatever the rule's scope. | _scope only_ |
|
|
134
|
-
| `outbound.vendor_allowlist` | Outbound calls go only to approved vendors | Reports outbound
|
|
135
|
-
| `stack.statement_forbidden` | Stacks exclude listed statements | Reports
|
|
136
|
-
| `stack.statement_order` | A statement comes before another | Requires
|
|
137
|
-
| `statement.containment` | Statements meet nesting requirements | Requires or forbids
|
|
138
|
-
| `statement.expression_rule` | An expression follows reference and filter rules | Checks
|
|
139
|
-
| `statement.param_bound` | A numeric parameter stays within bounds | Requires
|
|
140
|
-
| `statement.param_forbidden` | A parameter avoids forbidden values | Reports
|
|
141
|
-
| `statement.param_required` | Statements explicitly set a required parameter | Requires
|
|
142
|
-
| `table.auth_table_rules` | Endpoints use the single auth table |
|
|
143
|
-
| `table.coverage_required` | Tables are referenced by a required object | Requires each selected table to be reached by
|
|
144
|
-
| `table.field_attribute_required` | Schema fields have required attributes | Checks selected
|
|
145
|
-
| `table.tag_required` | Tables with matching fields carry a tag | Requires a tag on tables
|
|
146
|
-
| `table.view_hide_required` | Saved views hide sensitive fields | Requires every saved view of the selected tables to hide sensitive
|
|
147
|
-
| `table.write_location_restricted` | Table writes use approved functions or tags | Restricts writes to
|
|
148
|
-
| `test.assertion_required` | Tests assert anonymous calls are rejected | Requires a test that calls
|
|
149
|
-
| `trigger.write_trigger_effects` | Trigger writes account for the triggers they skip or re-fire | Reports
|
|
150
|
-
| `workspace.object_required` | Required objects exist | Requires objects of
|
|
136
|
+
| `outbound.vendor_allowlist` | Outbound calls go only to approved vendors | Reports outbound requests, and cloud, email and AI model providers, that are not on the approved vendor lists. Empty allowlists report destinations as not yet reviewed. The http kind covers api.request, stream.from_request, the ai.external.mcp statements, api.microservice to a dotted host, and file statements given a literal http(s) URL; a dynamic file value is usually a file resource and is not reported. cloud and email check the provider, agent.llm an agent's model provider; cloud.job runs locally and is excluded. db.external reads the host of a literal connection string of db.external.*.direct_query, or approves one that is exactly $env.NAME through env_hosts; a connection string with a dynamic tail, or whose database name or options hold anything but letters, digits and _ . $ - (options also % + = & / :), is unresolved, because that text could name another host. lambda scans literal api.lambda code: its literal URLs are checked, and network calls without one, or whose literal URL holds a JavaScript escape or is joined to text that could change its host, are reported as unverifiable. A URL resolves from a literal scheme://host prefix followed by /, ? or #, and one led by an environment variable passes when env_hosts lists that variable and anything joined after it starts with /, ? or #; a filter or condition applied to the whole URL leaves it unresolved. Env var values are not read: they are per workspace and per tenant and change without a branch change. Approve the variable in env_hosts to trust whoever sets it. Other dynamic or missing destinations are reported as unresolved. | `kinds`, `hosts`, `providers`, `env_hosts` |
|
|
137
|
+
| `stack.statement_forbidden` | Stacks exclude listed statements | Reports forbidden statements anywhere in an object's stack or in a function it calls. A name ending in .* forbids a namespace. Statements in functions the object calls count, including async calls, and are reported at the call; fixing the function, or exempting it with except_tags, clears every caller. return and loop controls in a called function are not attributed to the caller. Middleware, addons and agent tools are not followed: each is judged as its own object. Called functions are read whatever the rule's scope. A namespace covers statements added under it later. Recipes: raw SQL is ["db.direct_query", "db.external.*"], external MCP ["ai.external.mcp.*"], cloud file storage ["cloud.aws.s3.*", "cloud.azure.storage.*", "cloud.google.storage.*"], bulk writes ["db.bulk.*"]. db.* includes reads and cloud.* is not only storage; function.* and service.* both match every function call. | `statements*` |
|
|
138
|
+
| `stack.statement_order` | A statement comes before another | Requires one statement to always run before another, at any depth, such as a permission check before a database write. Every matching after statement must be preceded by a before that always runs ahead of it. Called functions and pre-middleware are followed. A before covers later statements of its own block, and reaches out of group, db.transaction, finally and a try whose catch rethrows; one inside a conditional branch, loop body, catch, a try that swallows failures or util.post_process covers only later statements in that same block. A guard in every branch of an if/else does not cover statements after the conditional (hoist it), and a guard written as conditional { throw } is not a before match (use precondition, or a guard function). An after in a function the object calls, not guarded inside that function, counts at the call site, async calls included; exempting the function with except_tags stops this. A synchronous call to a function holding an always-running before counts as a before at the call, unless a function on the way caches its result; an early return in a guard function before its check is not followed. An attached pre-middleware whose exception policy is critical or rethrow and that holds an always-running before covers the whole stack; a silent one does not. In a called function or middleware, must_reference is met only by $auth and $env references. A listed function counts only on a synchronous, uncached call; must_reference is checked on the call (its arguments), or through an $auth or $env reference inside the function. Objects with no after statement pass and are not counted. Called functions and the middleware chain are read whatever the rule's scope. | `before*`, `after*` |
|
|
139
|
+
| `statement.containment` | Statements meet nesting requirements | Requires or forbids blocks around selected statements, such as a try/catch around external requests, or requires statements nested inside them. Called functions are judged per call path. A bare try_catch means its try branch; name a branch (try_catch.catch) to target another. Checks every nesting depth; the matching block need not execute on every path. Functions are judged through the objects that call them: a statement in a function counts as inside a block when every call path puts it there, and an async call drops the caller's try_catch but keeps its loops. A function no in-scope object calls is judged on its own, so scope changes how a function is judged, not only whether it is reported. Exempting a function with except_tags stops following it; called functions are read whatever the rule's scope. | 1 of (`must_be_inside`, `must_not_be_inside`, `must_contain`), `statements*`, `min_count` |
|
|
140
|
+
| `statement.expression_rule` | An expression follows reference and filter rules | Checks what selected statement settings may contain, such as debug logs never reading request input: required or forbidden references, operators, literals and filters. References are traced through variables and called functions. A variable carries what is assigned to it (var and its mutators, foreach items, data transforms), and util.get_env, util.get_all_input, util.get_raw_input and util.get_vars carry everything they read; results of database, API and function calls carry nothing. must_not_reference fails when a listed reference may reach the param; must_reference is met by a reference written in the param, or by a variable every assignment of which carries it. Operators, literals and filters are read as written. A statement in a called function is judged through each caller: its $input means the arguments that caller passes, while $auth and $env keep their meaning; exempting a function with except_tags stops following it. $input is request data in endpoints, middleware, AI tools, message handlers and realtime or toolset triggers. In a database, workspace or error trigger, a task, and a function no in-scope object calls (judged on its own), $input is not request data: a $input entry in must_not_reference is not traced there, and one in must_reference is matched as written. So scope changes how a function is judged. An omitted parameter fails only a rule with must_reference or filters_required. Called functions are read whatever the rule's scope. | `statements*`, `param_names*`, `must_reference`, `must_not_reference`, `operators_forbidden`, `literals_forbidden`, `filters_forbidden`, `filters_required` |
|
|
141
|
+
| `statement.param_bound` | A numeric parameter stays within bounds | Requires a numeric statement setting, such as a timeout or a token lifetime, to stay between a minimum and a maximum. The listed params must lie within the inclusive bounds. An omitted param is judged at its runtime default. A variable assigned only literals, and a literal argument passed to a function, are resolved; arithmetic is not evaluated, and a value that cannot be resolved is reported. A numeric param is read as the runtime casts it ("3600" is 3600), and a value the runtime refuses passes, since the statement then never runs. Bounds use the param's native units. A statement with none of the params set and no runtime default is reported. A statement in a called function is judged through each caller, an argument resolved from what that caller passes; exempting a function with except_tags stops following it. A function in scope is also judged on its own, where a value read from its input is unresolvable only when no in-scope object calls it, so scope changes how a function is judged. Called functions are read whatever the rule's scope. | 1 of (`min`, `max`), `statements*`, `param_names*`, `unit` |
|
|
142
|
+
| `statement.param_forbidden` | A parameter avoids forbidden values | Reports statement settings set to a forbidden value, such as TLS certificate checks turned off, or to a value that cannot be resolved. An omitted param is judged at its runtime default. A variable assigned only literals, and a literal argument passed to a function, are resolved; arithmetic is not evaluated. Where the param's runtime type is boolean or numeric, values are compared as the runtime casts them (0, "0", "no" and "off" are false; "3600" is 3600), and a value the runtime refuses passes, since the statement then never runs; other params compare strictly. A statement in a called function is judged through each caller, an argument resolved from what that caller passes; exempting a function with except_tags stops following it. A function in scope is also judged on its own, where a value read from its input is unresolvable only when no in-scope object calls it, so scope changes how a function is judged. Called functions are read whatever the rule's scope. | `statements*`, `param_names*`, `values*` |
|
|
143
|
+
| `statement.param_required` | Statements explicitly set a required parameter | Requires selected statement settings to be set explicitly, including in called functions and attached addons. For output, requires a customized field list, which db.query and db.get write as output = ["id", "name"]; a dotted entry reaches inside a paged result (items.book_name). To forbid particular fields, use db.output_fields_forbidden. A runtime default does not count, and neither does a value equal to the default XanoScript leaves out of the source (timeout = 10 or verify_peer = true on api.request), since a pull does not show it and the next push drops it; use statement.param_bound or param_forbidden when the value matters. Each listed param a statement declares must be set, so one rule can span statements with different params; a listed statement declaring none of them, or a param no listed statement declares, is a rule warning. Every addon the object's statements attach, and those attached in functions it calls, is inspected as the query it runs; an addon in scope is also judged on its own. A statement in a called function is reported on the caller, and the function is still judged on its own when in scope; exempting a function or an addon with except_tags stops following it. Called functions are read whatever the rule's scope. | `statements*`, `param_names*`, `table_tags` |
|
|
144
|
+
| `table.auth_table_rules` | Endpoints use the single auth table | Requires exactly one table to hold user logins on the branch, and every authenticated endpoint to use it, unless approved auth tables are listed. With auth_tables empty, exactly one auth-enabled table is required. With auth_tables set, only listed tables may be auth-enabled, and authenticated queries must use one. Without a list, any other count reports the workspace once, plus each query whose declared auth table is missing or not auth-enabled. With a list, each auth-enabled table not listed is reported on itself; a listed table need not exist, and a branch with no auth table passes (to require one, use workspace.object_required). This check is not for backends without sign-in. The auth-table count always covers the whole branch; scope narrows the queries reported, and the tables reported when auth_tables is set. Without auth_tables the workspace counts as checked; with it, only the scoped queries and auth-enabled tables do, so a rule whose scope selects nothing checks nothing. A listed table that is not auth-enabled is a rule warning. | `auth_tables` |
|
|
145
|
+
| `table.coverage_required` | Tables are referenced by a required object | Requires each selected table to be reached by an object that can run, such as a scheduled task that cleans it up. Scope selects the tables; referenced_by selects the covering objects. An object reaches a table directly or through called functions, attached addons and enabled agent or MCP tool mappings; disabled statements do not count. With referenced_by.statements set, only those statements aimed at the table as their primary table count, in the object or a function it calls; db.direct_query counts only with static SQL naming the table physically (mvpw<workspace>_<table id>) beside DELETE, TRUNCATE or DROP, and an addon never qualifies. A task can run only when active with a repeating schedule that has not ended, and a trigger unless inactive; a covering object that cannot run is named instead. Whether a schedule has ended is judged at the evaluation date, so a rule can start failing, and a merge gate start blocking, without a definition change once an end date passes. Only tables count as checked; covering objects are read whatever the rule's scope. | `table_selector`, `referenced_by` |
|
|
146
|
+
| `table.field_attribute_required` | Schema fields have required attributes | Checks selected table fields for a required attribute or type, such as being marked sensitive, or forbids them. When names and types are both set, a field must match both. Fields are selected at every depth: a bare name matches that name anywhere, a dotted name (profile.ssn) that exact path, and a list of objects by element path; a json field's contents are not inspected. Reads schema definitions only. Attributes are sensitive, visibility (public, private or internal), required and nullable (what the ? marker sets), default, description, values, list, list.min, list.max and filter.<name> (an enabled filter of that name is declared); a raw path into the stored field is also accepted, and one that no selected field on the branch has makes the rule inert, with a warning. | 1 of (`field_names`, `field_types`), `attribute`, `value`, `type`, `must_exist`, `forbidden` |
|
|
147
|
+
| `table.tag_required` | Tables with matching fields carry a tag | Requires a tag, such as confidential, on tables that hold a selected field or, when asked, any field marked sensitive. With include_sensitive set, any sensitive field counts. Reads schema definitions only. A selected field matches a listed name and, when field_types is set, one of those types. Fields match at every depth: a bare name anywhere, a dotted name (profile.notes) that exact path; a json field's contents are not inspected. Sensitive means marked sensitive in the schema or password-typed. Only tables with a matching field count as checked. | 1 of (`field_names`, `include_sensitive`), `field_types`, `tag*` |
|
|
148
|
+
| `table.view_hide_required` | Saved views hide sensitive fields | Requires every saved view of the selected tables to hide fields marked sensitive, password fields and any listed fields. A share link redacts rows by its view's hidden columns. Sensitive and password fields are always required; fields adds to them. Saved views belong to the table, not to a user, and any of them can be attached to a share link, whose redaction reads the view live on each request, so editing a view changes what existing share links expose. A share link created with Studio's Default view, or whose view was deleted, shares every field except @meta, sensitive fields included; share links are outside the branch, so this check cannot see them and only guarantees that saved views hide these fields. CSV exports use the columns chosen at export time, not a saved view, so this check does not govern them. A nested field counts as hidden when its path or an ancestor is hidden. Select tables with tags. | `fields` |
|
|
149
|
+
| `table.write_location_restricted` | Table writes use approved functions or tags | Restricts writes to selected tables to approved functions and tagged objects; with no approved function or tag, every write is reported. Writes in called functions count on the caller, and approval does not pass down to what an approved function calls. A write counts when it targets a restricted table and, when fields is set, touches a listed field that table has; fields names apply only to listed tables that have them, and table.field narrows a name to one table. Deletes, truncation and whole-record replacements affect every field, and dynamic record values are treated as possibly touching them, except that a last pick with a literal key list touches only the picked keys. db.direct_query is scanned: dynamic SQL (the template engine, ?:raw or ?:alias) may write any restricted table, and static SQL writes one it names physically (mvpw<workspace>_<table id>) beside a write keyword. Writes through stored procedures, SQL functions, views or database triggers, a table named other than physically, and db.external.*.direct_query are not seen; for certainty forbid db.direct_query with stack.statement_forbidden. allowed_tags reads each object's own tags; an API group's tags do not approve its endpoints (tag each approved object), while scope except_tags does include API group tags, so a group carrying an excepted tag exempts all its endpoints. Called functions are read whatever the rule's scope. Middleware, api.call to other endpoints and database triggers fired by a write are not followed: each is judged as its own object when in scope, which an api_groups-only scope drops. | `restricted_tables*`, `fields`, `statements`, `allowed_functions`, `allowed_tags` |
|
|
150
|
+
| `test.assertion_required` | Tests assert anonymous calls are rejected | Requires, for each endpoint that requires a login, a test that calls it without one and asserts that it is rejected. A tokenless endpoint unit test counts too. Anonymous means no token (or a literal null, empty or false one) and no Authorization header in literal headers; a computed token or headers may authenticate. The rejection is asserted by expect.to_throw wrapping the call with the text Unauthorized, Authentication Required or Unauthorized - Authentication Required (whole, any case; an empty text would accept any failure), or by a later expect.to_equal or expect.to_contain on the call result's code or message with ERROR_CODE_UNAUTHORIZED or one of those texts; an endpoint unit test with no token counts with such a to_throw expectation. A workflow test's api.call does not yet enforce the endpoint's auth when called without a token, so such a test fails at run time until the platform does; an endpoint unit test observes the rejection today. Endpoints that do not require authentication are skipped: they cannot reject an anonymous call. Tests are read, not run; every workflow test and the endpoints' unit tests are read whatever the rule's scope, and an inactive workflow test counts for nothing. | _scope only_ |
|
|
151
|
+
| `trigger.write_trigger_effects` | Trigger writes account for the triggers they skip or re-fire | Reports writes made inside a table trigger that skip another table's own triggers, or that re-fire the same trigger. Writes made synchronously inside a trigger fire no database triggers on any table; writes in async functions do. A synchronous write to the table a database trigger fires on is safe and passes. Every trigger kind is inspected for skipped triggers; only database triggers can re-fire themselves. Writes in called functions are followed and other tables' database triggers are read, whatever the rule's scope; a write is asynchronous once its call chain passes through an async function call, and writes made by an AI agent's tools are not followed. db.direct_query counts when its static SQL names a table physically; dynamic SQL is not attributed. A skipped trigger with a when-filter might not have matched anyway, and the finding says so. | _scope only_ |
|
|
152
|
+
| `workspace.object_required` | Required objects exist | Requires objects of a selected kind to exist and be able to run: each listed name, or at least a minimum number in scope. Checks object presence, not behavior. A task counts when active with a repeating schedule that has not ended, a trigger when active, an MCP server or AI tool when enabled; one that cannot run is named. Whether a schedule has ended is judged at the evaluation date, so a rule can start failing without a definition change once an end date passes. names matches the stored name: for an endpoint its path, met by any verb in any API group (narrow with api_groups and verbs). Scope tags narrow the objects counted, an endpoint also carrying its API group's tags. object_kind workspace always counts one. | `object_kind*`, `names`, `min_count` |
|
|
151
153
|
|
|
152
154
|
Closed value sets worth knowing without a catalogue round-trip:
|
|
153
155
|
|
|
@@ -251,9 +253,15 @@ Read the policy before editing anything: its `statement`, and the failed rule's
|
|
|
251
253
|
|
|
252
254
|
Fix at most three objects before checking back with the user, blocking findings first. Never quote any part of a secret in a reply, not even a prefix. Never weaken a rule silently, and never infer an intent the `statement` does not state. In a non-interactive run, make only the first class of change and report the rest.
|
|
253
255
|
|
|
256
|
+
### An object's coverage and draft checks
|
|
257
|
+
|
|
258
|
+
In the dashboard, an object's page shows a **Policies** chip and panel: the active policies that apply to it and why, and its findings in the branch's newest run (`Policies ✓ 6 pass`, `Policies 2 blocking · 1 advisory`, `3 apply · not checked yet`, `Last check failed`, `None apply`). A member without `workspace:policy` read who may read the object sees it too, trimmed: each applying policy's key, title, Blocking or Advisory and why it applies, the passing ones included, and each finding's policy key, rule name, message and the check's fix hint (opened: the check's label and the first sentence of its description). It leaves out statements, rule settings and warnings, links to the policy and its reports, and other objects' findings, and ends with a muted note that full details need `workspace:policy` read. The same trimmed answer is served on the Metadata API (`GET /workspace/{id}/policy/object/coverage?type=&id=&branch=`), by `xano policy coverage <type>:<id>` and by the authenticated MCP's `xano_get_policy_coverage` (the workspace object's id is the workspace's own id: `workspace:17`); it needs only the object kind's own read permission (see Permissions). The answer is the same for every caller and is cached for 60 seconds by object, the branch's latest run and the workspace's checksum with the policies' fingerprint, so a write, a policy change or a new run is never answered from the cache. Without policy read the rule and its statement cannot be read, so fix from the message and fix hint, and ask the policy's owner when the rule's intent matters.
|
|
259
|
+
|
|
260
|
+
While an object has a draft, Studio checks that draft alone, laid over the published branch, when the XanoScript editor saves it or when **Check draft** in the chip or panel is pressed; it does not check on page open (`Draft not checked`). The draft's result replaces the published one, labelled Draft, with New and Fixed markers, a count of the findings it introduces on other objects (linked for policy readers, a count only for anyone else) and, on the live branch, whether publishing it would be refused. Only a member who may edit the object (its kind's update permission, as Save asks) has its draft checked. A draft check stores nothing (no run, report or audit row), runs in its own small pool and answers busy when every slot is taken (check again in a moment); a slot's lease is renewed between rules while its check runs, so a check of a large branch keeps its slot, and a worker that dies frees it within a minute. Each member may ask for 20 draft checks a minute in a workspace (past that, 429 `policy_draft_check_rate_limited` with `retry_after`, which Studio also shows as busy), and a draft is at most 1 MiB as JSON (400 `policy_draft_too_large`; Studio says `This draft is too large to check.` without sending it). It is Studio-only: the Metadata API, the CLI and the MCP have no draft check, so outside Studio evaluate after the change is saved or pushed.
|
|
261
|
+
|
|
254
262
|
## Following policies while you change code
|
|
255
263
|
|
|
256
|
-
Policies are not only for policy work. When the branch has **active** policies (files under `policies/`, or a non-empty `xano_list_policies` / `xano policy list`), every code change should keep to the active **
|
|
264
|
+
Policies are not only for policy work. When the branch has **active** policies (files under `policies/`, or a non-empty `xano_list_policies` / `xano policy list`), every code change should keep to the active **blocking** ones — their findings refuse a merge, a publish or push to the live branch, and a tenant deploy — and ideally to the advisory ones too:
|
|
257
265
|
|
|
258
266
|
1. Before writing code, read the active policies that apply to what you are changing (their `statement` and rules).
|
|
259
267
|
2. Write code that meets them. A rule you cannot meet is a question for the user, not something to route around (see above: never exempt the object yourself).
|
|
@@ -273,6 +281,8 @@ Every policy request passes the same gates. A refusal is an HTTP 403, and its `p
|
|
|
273
281
|
| Writable session | A write (create, update, restore, delete) comes from a session that may write: not a read-only Studio session or a read-only impersonation | none | `This is a read-only session. Enable editing to modify this resource.` |
|
|
274
282
|
| OAuth ceiling | An OAuth token carries `workspace:read` (reads) or `workspace:write` (writes) | none | `insufficient_scope: workspace:read` or `workspace:write` |
|
|
275
283
|
|
|
284
|
+
One route family is the exception: an object's coverage (`policy/object/coverage`, both APIs) and Studio's draft check need the object kind's own permission instead of `workspace:policy`, **read** for coverage and **update** for the draft check, since someone who may not edit an object has no draft of it (`workspace:api` for an endpoint or API group, `workspace:function`, `workspace:database` for a table, `workspace:task`, `workspace:middleware`, `workspace:addon`, `workspace:workflow_test`, `workspace:tool` for tools, agents and MCP servers, `workspace:realtime` for channels and messages, `workspace:settings` for the workspace; a trigger's by what it is attached to, its `obj_type`: `workspace:database` for a table trigger, `workspace:tool` for an agent or MCP server trigger, `workspace:realtime` for a realtime trigger, `instance:workspace` for a workspace or error trigger and for a trigger the branch does not hold, and all four for one whose `obj_type` cannot be resolved; a trigger the caller may not use is answered exactly as one the branch does not hold, refused naming `instance:workspace` or a 404 to a caller who holds it, so its existence never shows), behind the same feature gate and OAuth `workspace:read` ceiling, which is checked first. Its refusal is `policy_object_permission_required` (403, with `permission`, `level` (`read` or `update`) and `type`): `Reading this function needs the workspace:function read permission.`, or for a draft check `Checking a draft of this function needs the workspace:function update permission.`
|
|
285
|
+
|
|
276
286
|
Both coded permission refusals also carry `permission` (`workspace:policy`) and `level`. A refused push lists the policy files it would have written in `payload.policies`, and its message ends `; nothing was imported: KEY, KEY`. The remedy follows the code: `policy_permission_required` needs an instance admin to grant the role's Workspace Policies permission (a new token does not help); `policy_scope_required` needs a token created with the level.
|
|
277
287
|
|
|
278
288
|
The `workspace:policy` permission level each operation needs:
|
|
@@ -281,13 +291,15 @@ The `workspace:policy` permission level each operation needs:
|
|
|
281
291
|
| --- | --- | --- |
|
|
282
292
|
| List, get, check catalogue, policies for an object, runs, one run (whole, its summary or its findings pages), parse | `read` | `workspace:read` |
|
|
283
293
|
| Evaluate (run checks) | `read` | `workspace:read` |
|
|
294
|
+
| One object's coverage (`policy/object/coverage`) | none: the object kind's own read permission | `workspace:read` |
|
|
295
|
+
| Studio's draft check | none: the object kind's own update permission | `workspace:read` |
|
|
284
296
|
| Create a policy | `create` | `workspace:write` |
|
|
285
297
|
| Update a policy, restore a version | `update` | `workspace:write` |
|
|
286
|
-
| Delete a policy | `delete`, and `update` as well for an active
|
|
298
|
+
| Delete a policy | `delete`, and `update` as well for an active blocking policy | `workspace:write` |
|
|
287
299
|
| `workspace pull` / export with policies included | `read` (without it the export still succeeds and omits policies) | `workspace:read` |
|
|
288
|
-
| `workspace push` / import of a policy file that differs from the stored policy | `create` or `update`, and `update` for a push to the live branch that weakens a
|
|
289
|
-
| Archive import carrying policies | `create` and `update` (without them the archive imports and its policies are skipped, each skip written to the audit log); an import that would delete existing policies needs `delete`, and `update` as well to remove an active
|
|
290
|
-
| Branch merge that adds, changes or deletes a policy | `create`, `update` or `delete` for what it changes, and `update` for a weakening of a
|
|
300
|
+
| `workspace push` / import of a policy file that differs from the stored policy | `create` or `update`, and `update` for a push to the live branch that weakens a blocking policy (see Gates) | `workspace:write` |
|
|
301
|
+
| Archive import carrying policies | `create` and `update` (without them the archive imports and its policies are skipped, each skip written to the audit log); an import that would delete existing policies needs `delete`, and `update` as well to remove an active blocking policy of the branch it writes | - |
|
|
302
|
+
| Branch merge that adds, changes or deletes a policy | `create`, `update` or `delete` for what it changes, and `update` for a weakening of a blocking policy (see Gates) | - |
|
|
291
303
|
| Override a blocking gate | `update` (with a reason) | `workspace:write` |
|
|
292
304
|
| Release cut from a branch or tenant, tier1 tenant, ephemeral or sandbox push, release deploy | none: this is deployment, not authoring | - |
|
|
293
305
|
| `release push` (a release built from files), or a release archive upload that carries policies | `create` and `update` to carry its policy files; without them `release push` carries the workspace's live-branch policies instead (naming the files in `policies_skipped` when they differ) and an archive upload is refused | - |
|
|
@@ -301,8 +313,10 @@ Evaluate needs only `read`, so a reviewer or a CI credential can run checks. Sto
|
|
|
301
313
|
|
|
302
314
|
A policy file that is identical to the stored policy needs no write permission in a push: it is reported `unchanged` and skipped. A policy file that differs, pushed by a caller whose `workspace:policy` permission does not allow that change, refuses the whole push before anything is imported, naming the policy keys (`policy_permission_required` or `policy_scope_required`, with `payload.policies`). Exclude the policy files (`xano workspace push -e "policies/*"`) or pull again to push the rest.
|
|
303
315
|
|
|
304
|
-
What a policy reader can see: a finding names the object it is about - its type, name and id - and says where in the stack the problem is, for any object on the branch. `workspace:policy` read therefore shows object names and ids across the branch even to a role with no access to, say, the database or that API group. The credential check never prints the literal it matched; it names the SHA-256 fingerprint instead. A rule's `allowed_secrets` lists the fingerprints (`sha256:` and 64 lowercase hex digits, e.g. from `printf %s "$VALUE" | shasum -a 256`, or copied from the finding) of values the owner reviewed, and the check skips them wherever it looks. A policy never holds the value itself: any other entry is refused, naming only its position, and an entry that allows nothing is a rule warning. Allowing a secret weakens the policy, so an agent adds one only when the user asks. A gate refusal
|
|
316
|
+
What a policy reader can see: a finding names the object it is about - its type, name and id - and says where in the stack the problem is, for any object on the branch. `workspace:policy` read therefore shows object names and ids across the branch even to a role with no access to, say, the database or that API group. The credential check never prints the literal it matched; it names the SHA-256 fingerprint instead. A rule's `allowed_secrets` lists the fingerprints (`sha256:` and 64 lowercase hex digits, e.g. from `printf %s "$VALUE" | shasum -a 256`, or copied from the finding) of values the owner reviewed, and the check skips them wherever it looks. A policy never holds the value itself: any other entry is refused, naming only its position, and an entry that allows nothing is a rule warning. Allowing a secret weakens the policy, so an agent adds one only when the user asks. A gate refusal lists its blocking findings only to a caller who holds `workspace:policy` read; anyone else gets the counts, the run id and, in its message, the keys of the policies they come from.
|
|
317
|
+
|
|
318
|
+
A `workspace push` (or upload-URL import) by a caller without `workspace:policy` read is evaluated as anyone's is, and the run is stored, but its `policy_check` tells that caller only their own findings on the objects the push carried that they may read (a push that carries the workspace document carries the workspace object too, listed to a caller with `workspace:settings` read), trimmed as an object's coverage is: `{status, message, blocking, run_id: 0, access: "coverage", scope: "pushed_objects", findings, blocking_findings, elsewhere {total, blocking, basis}, results: [], counts {findings, blocking, errors}, total, truncated, note}`. Each finding is `{id, policy_key, policy_title, rule_title, message, blocking, deleted, object, check {label, description, fix_hint} or null}`. The counts are about those findings, except `counts.errors`, the branch's rules that could not run. `elsewhere` counts, never names, the findings on the objects it does not list: with `basis: "introduced"`, those the push introduced (on the live branch, not in the push gate's own evaluation of the branch just before the push; on any other branch, not in the branch's newest run just before the push, while that run still described the branch); with `basis: "all"`, when no such baseline was known, every finding there, existing ones included. Which objects are theirs follows the coverage rule (see Permissions), a trigger by its `obj_type`. `blocking` is what a reader's push of the same change says (the branch holds a blocking finding after it), so the CLI exits 2 for the same push whoever made it, even with nothing of theirs listed; `status` is `fail` when anything is listed, `elsewhere.total` is above 0 or `blocking` is true, else `error` when a rule errored, else `pass`. An older platform answers such a caller `forbidden` and evaluates nothing.
|
|
305
319
|
|
|
306
|
-
Policy text stays behind this permission. Git sync carries no policies: it leaves the policy files out of the repository, and its commit message says how many. The workspace audit log names each policy change by the policy's identity (id, key, title, version, active, enforcement, actor and action), never its document or source, which live in Version History behind policy read.
|
|
320
|
+
Policy text stays behind this permission. Git sync carries no policies: it leaves the policy files out of the repository, and its commit message says how many. The workspace audit log names each policy change by the policy's identity (id, key, title, version, active, enforcement, actor and action), never its document or source, which live in Version History behind policy read. Request history follows the same line: for a viewer without `workspace:policy` read (or while the policies feature is off), a Metadata API call that carries policy details (a policy route, the object coverage route included, a policy refusal, a push's `policy_check`, a policy document) shows `Hidden: this call carries policy details, which need workspace:policy read.` as its whole input and output. An endpoint's own request history is never masked.
|
|
307
321
|
|
|
308
322
|
Policies are saved directly, not drafted. `active = false` makes a policy inactive; it does not create a draft. New authored source and structured saves refuse `lifecycle` with `policy: "lifecycle" was replaced by "active"; write active = true or active = false.` Source refusals include the line and column. Stored/imported legacy policies are migrated (`draft` becomes `active: false`); explicit boolean `active` takes precedence. An active policy needs at least one rule; set `active = false` instead to save one without rules.
|
|
@@ -158,7 +158,7 @@ input {
|
|
|
158
158
|
|
|
159
159
|
### Workspace policies
|
|
160
160
|
|
|
161
|
-
If the project has a `policies/` folder, the branch has governance policies. Keep to the active
|
|
161
|
+
If the project has a `policies/` folder, the branch has governance policies. Keep to the active blocking ones while you write code (their findings block merges), then evaluate after changing code: `xano policy evaluate`, the `policy_check` a `xano workspace push` returns, or `xano_evaluate_policies`. `topic: "policies"` has the details.
|
|
162
162
|
|
|
163
163
|
### Available Topics
|
|
164
164
|
|
|
@@ -653,7 +653,7 @@ var $msg { value = ($status|to_text) ~ ": " ~ ($data|json_encode) }
|
|
|
653
653
|
|
|
654
654
|
## Workspace policies
|
|
655
655
|
|
|
656
|
-
If the project has a `policies/` folder, the branch has governance policies. Keep to the active
|
|
656
|
+
If the project has a `policies/` folder, the branch has governance policies. Keep to the active blocking ones while you write code (their findings block merges), then evaluate after changing code: `xano policy evaluate`, the `policy_check` a `xano workspace push` returns, or `xano_evaluate_policies`. `topic: "policies"` has the details.
|
|
657
657
|
|
|
658
658
|
## Topic Index
|
|
659
659
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/developer-mcp",
|
|
3
|
-
"version": "2.3.0-beta.
|
|
3
|
+
"version": "2.3.0-beta.3",
|
|
4
4
|
"description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
|
|
5
5
|
"mcpName": "io.github.xano-inc/xano-developer-mcp",
|
|
6
6
|
"type": "module",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"license": "MIT",
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
66
|
-
"@xano/xanoscript-language-server": "^12.
|
|
66
|
+
"@xano/xanoscript-language-server": "^12.19.0",
|
|
67
67
|
"minimatch": "^10.1.2",
|
|
68
68
|
"zod": "^4.0.0"
|
|
69
69
|
},
|