rig_stage_set
Attach a DESIGNED DASHBOARD to a rig you own — a stored, self-contained HTML template rendered after EVERY run with that run's data injected. Without this an outside agent could author a rig but never give it a face, so its runs left a trace and nothing to look at. The template MUST contain the l...
This record as markdown: /tools/ai-rokha-rokha/rig-stage-set.md
What rig_stage_set does on Rokha
AI agents use rig_stage_set to create or update resources in Rokha, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Rokha environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
clear | boolean | — | true = remove the rig's stage. |
title | string | — | Optional dashboard title. |
rig_id | string | Yes | UUID of the SAVED rig (rig_author returns it). |
data_source | string | — | 'last_step' (default) or 'step:<tag>'. |
template_html | string | — | Self-contained HTML carrying the __ROKHA_DATA__ slot. |
Parameters from the server's own tool schema.
Why rig_stage_set is rated Medium
Modifies rig configuration by attaching a dashboard template; reversible write operation with potential for template injection.
From the tool's definition Attach a DESIGNED DASHBOARD to a rig you own — stored, self-contained HTML template
Risk signalsBulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
The rule that runs rig_stage_set safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Rokha, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For rig_stage_set, this is the rule to start with:
rig_stage_set stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Rokha, apply this rule, and every rig_stage_set call is checked against it from then on.
Questions about rig_stage_set
Attach a DESIGNED DASHBOARD to a rig you own — a stored, self-contained HTML template rendered after EVERY run with that run's data injected. Without this an outside agent could author a rig but never give it a face, so its runs left a trace and nothing to look at. The template MUST contain the literal __ROKHA_DATA__ slot; at run completion every occurrence is replaced with the chosen step's JSON (script-context-escaped), so write <script>const DATA = __ROKHA_DATA__;</script> and build from DATA. RULES: fully self-contained (inline ALL CSS/JS, images as data: URIs — the stage frame blocks every network request, and external src/href are REFUSED at save), <=400k chars, LIGHT-FIRST: dark ink on a light ground the template paints on its OUTERMOST wrapper (background #fafbfd, ink #10161f, cyan accent #0b7fa8) — the stage embeds on a light canvas, so a dark page is unreadable there; at most one bounded near-black band as an accent, never the page ground. data_source: 'last_step' (default) or 'step:<tag>' to feed from a NAMED step — how a rig whose last step is a data-write still stages the step you care about. clear: true removes the stage. Requires Authorization: Bearer <JWT>; the rig must be yours. It is categorised as a Write tool in the Rokha MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
rig_stage_set accepts 5 parameters: clear, title, rig_id, data_source, template_html. Required: rig_id. The full parameter table on this page comes from the server's own tool schema.
Register the Rokha MCP server in PolicyLayer and add a rule for rig_stage_set: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Rokha. Nothing to install.
rig_stage_set is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the rig_stage_set rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for rig_stage_set. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
rig_stage_set is provided by the Rokha MCP server (https://rokha.ai/mcp/jsonrpc). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Rokha, and thousands of servers like it.
This server
Across the catalogue