Documentation Index
Fetch the complete documentation index at: https://docs.svantic.com/llms.txt
Use this file to discover all available pages before exploring further.
A2UI
What it is
SensitiveFormRouter is a client-side helper. Agents can emit interactive forms via A2UI instead of going back and forth over chat. When a form’s metadata marks it as sensitive, the user’s values (passwords, API keys, PII, payment details) must never flow back through the agent or the LLM. SensitiveFormRouter is the single call your UI makes to do the right thing:
- For sensitive forms: POST the values directly to the
submit_urlthe platform included on the form, and produce a sanitizedagent_messageyou can show the agent (“user submittedlogin_formwith fields: email, password (redacted)”) so the conversation stays coherent. - For non-sensitive forms: pass the values back as
action_datafor the agent to consume normally.
When to use it
You’re building any of:- A web chat UI for Svantic agents.
- The terminal CLI (the built-in terminal uses this internally).
- A custom embed (Slack, Teams, a mobile app).
Functional usage
SensitiveFormRouter.route(options)
- When
sensitive === trueandsubmit_urlis set, POSTs{ values, action }tosubmit_urland returns a sanitizedagent_messagedescribing the outcome (values redacted). - Otherwise returns
{ routed_to: 'agent', action_data: values, agent_message }so the client can send the values to the agent normally.
submit_url fails. The agent never sees secret values either way.
FormRouteOptions
| Field | Type | Purpose |
|---|---|---|
values | Record<string, string> | The form values the user entered. |
action_name | string | Human-readable form action (used in the sanitized message). |
sensitive? | boolean | Set from the form metadata Svantic emitted. |
submit_url? | string | Secure endpoint to POST sensitive data to. |
FormRouteResult
| Field | Type | Description |
|---|---|---|
routed_to | 'submit_url' | 'agent' | Where the data went. |
agent_message | string | Message to forward to the agent (never contains sensitive values). |
action_data? | Record<string, string> | Present only when routed_to === 'agent'. The original values, for non-sensitive forms. |
