Skip to content
11 changes: 11 additions & 0 deletions docs/site/SITE_OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ All cross-page links must target these exact Starlight routes (with `docs/site/s
| **Guides** | How to Integrate A2UI into a Client | **P1** | `content/docs/guides/client-integration.mdx` | `/guides/client-integration/` |
| **Guides** | How to Integrate A2UI into an Agent | **P1** | `content/docs/guides/agent-integration.mdx` | `/guides/agent-integration/` |
| **Guides** | How to Define a Catalog | **P1** | `content/docs/guides/defining-a-catalog.mdx` | `/guides/defining-a-catalog/` |
| **Guides** | How to Restrict URLs | **P1** | `content/docs/guides/url-security.mdx` | `/guides/url-security/` |
| **Guides** | Using Macros | **P2** | `content/docs/guides/macros.mdx` | `/guides/macros/` |
| **Guides** | Architecting an A2UI Integration | **P2** | `content/docs/guides/architecting-an-integration.mdx` | `/guides/architecting-an-integration/` |
| **Guides** | How to Improve Latency | **P2** | `content/docs/guides/improving-latency.mdx` | `/guides/improving-latency/` |
Expand Down Expand Up @@ -313,6 +314,16 @@ _(Where `<ver>` is `v1.0` or `v0.9.1`.)_
5. **Client-Server Schema Parity Testing**:
- > **[VERIFICATION REQUIREMENT FOR IMPLEMENTING AGENT]**: Compare normalized `Catalog.fromJson` / `Catalog.from_json` objects rather than raw JSON strings (inspect `dart/a2ui_core/test/catalog_json_test.dart` to see how SDKs normalize `protocolVersion`, `$ref`s, and function schemas across Python, TypeScript, Dart, Swift, and Kotlin).

<a id="how-to-restrict-urls"></a>

#### How to Restrict URLs (`/guides/url-security/`) [P1]

- **Sources**: [`specification/proposals/url_security_policy.md`](../../specification/proposals/url_security_policy.md), [`conformance/core/url_security_policy.yaml`](../../conformance/core/url_security_policy.yaml), and `typescript/core/web_core/src/security/`.
- **Content Outline**:
1. **Overview**: Purpose statement and the exfiltration threat (a prompt-injected agent putting data-model values into an agent-supplied URL).
2. **Core Path**: Set `urlSecurityPolicy` on `MessageProcessor` (`AllowlistUrlSecurityPolicy` per-context host lists), mark custom component URL props (`mediaUrl()` / `navigationUrl()` / `iframeUrl()` and `x-a2ui-url-context` in catalog JSON, `none` opt-out), check URLs custom code builds with `sanitizeUrl` on `DataContext` / `ComponentContext`, and watch `URL_BLOCKED` warnings.
3. **Additional Steps**: URL contexts and the baseline, allowlist host rules (wildcards, ports, `allowRelative`, `allowSvgDataUrls`), `rewrite` hooks, custom `UrlSecurityPolicy` implementations, `openUrlHandler`, the `urlProperties` map for catalogs the host can't edit, the agent payload check (`checkPayloadUrls` in `@a2ui/agent`), unmarked URL property warnings, limits (custom code fetching on its own, CSP as backstop), and per-SDK availability.

<a id="macros"></a>

#### Using Macros (`/guides/macros/`) [P2]
Expand Down
4 changes: 4 additions & 0 deletions docs/site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ export default defineConfig({
label: 'How to Define a Catalog',
slug: 'guides/defining-a-catalog',
},
{
label: 'How to Restrict URLs',
slug: 'guides/url-security',
},
{
label: 'Using Macros',
slug: 'guides/macros',
Expand Down
1 change: 1 addition & 0 deletions docs/site/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Parallel Markdown editions of documentation pages are available by appending `.m
- [How to Integrate A2UI into a Client](https://a2ui.org/guides/client-integration/) ([Markdown](https://a2ui.org/guides/client-integration.md))
- [How to Integrate A2UI into an Agent](https://a2ui.org/guides/agent-integration/) ([Markdown](https://a2ui.org/guides/agent-integration.md))
- [How to Define a Catalog](https://a2ui.org/guides/defining-a-catalog/) ([Markdown](https://a2ui.org/guides/defining-a-catalog.md))
- [How to Restrict URLs with a URL Security Policy](https://a2ui.org/guides/url-security/) ([Markdown](https://a2ui.org/guides/url-security.md))
- [Using Macros](https://a2ui.org/guides/macros/) ([Markdown](https://a2ui.org/guides/macros.md))
- [MCP Overview](https://a2ui.org/guides/mcp-overview/) ([Markdown](https://a2ui.org/guides/mcp-overview.md))
- [Call MCP Tools from A2UI](https://a2ui.org/guides/mcp-catalog/) ([Markdown](https://a2ui.org/guides/mcp-catalog.md))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ When your agent streams a `createSurface` and `updateComponents` message pair, t
- **Child components** (`ChildSchema` / [`ComponentId`](../../specification/v1.0/schemas/#common_types.json/$defs/ComponentId) and `ChildListSchema` / [`ChildList`](../../specification/v1.0/schemas/#common_types.json/$defs/ChildList)): resolves to a child reference or array of references. Pass each entry to `this.renderNode(ref)` inside `render()` to mount Basic Catalog, universal, or native React and Angular children.
- **Two-way data binding** (`DynamicStringSchema`, `DynamicNumberSchema`, `DynamicBooleanSchema`, `DynamicStringListSchema`, `DynamicValueSchema` / [`DynamicValue`](../../specification/v1.0/schemas/#common_types.json/$defs/DynamicValue)): generates a `props.set<CapitalizedProp>(nextValue)` setter (such as `props.setValue(e.target.value)`) that writes to the bound JSON Pointer (`@path` in v1.0, `path` in v0.9.1) in the surface `DataModel` (see [Data Model and Data Binding](../../concepts/data-binding/)).
- **Validation checks** (`z.object({...}).merge(CheckableSchema)` / [`Checkable`](../../specification/v1.0/schemas/#common_types.json/$defs/Checkable)): evaluates `@checks` rules (`checks` in v0.9.1) reactively and populates `props.isValid` (`boolean`) and `props.validationErrors` (`string[]`). Bind `aria-invalid` and `aria-describedby` on the inner input control rather than `role="alert"` so initial validation checks do not trigger unsolicited screen-reader announcements on mount.
- **URLs** (`mediaUrl()`, `navigationUrl()`, `iframeUrl()`): resolves to the URL the surface's URL security policy allowed (possibly rewritten), or `undefined` when the policy blocks it. Declare every property that holds a URL your element loads, opens, or embeds with one of these helpers instead of `DynamicStringSchema` (see [Mark URL properties on custom components](../url-security/#step-2-mark-url-properties-on-custom-components)).

## Advanced topics

Expand Down
11 changes: 11 additions & 0 deletions docs/site/src/content/docs/guides/defining-a-catalog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,17 @@ Notice that v1.0 uses `@accessibility` and `@path`, whereas v0.9.1 uses `accessi

In your native component implementation, map resolved `AccessibilityAttributes` and visible child text or titles to platform accessibility APIs. Use WAI-ARIA attributes on the web, `Semantics` widgets in Flutter, and `.accessibilityLabel` or `.accessibilityHint` modifiers in SwiftUI. When an instance sets `@accessibility.label` or `@accessibility.description` (or `accessibility.label` and `accessibility.description` in v0.9 and v0.9.1), let those values override any label inferred from visible text (see [Catalog-Agnostic Accessibility Requirements](../../specification/v1.0-a2ui/#catalog-agnostic-accessibility-requirements)).

### URL properties

Mark every component property that holds a URL the renderer loads, opens, or embeds with `"x-a2ui-url-context"` (`"media"`, `"navigation"`, or `"iframe"`) next to its type, so the host's URL security policy checks it before your widget sees it. Agents don't send the keyword, so payloads stay the same. A custom widget or function that builds a URL itself, or opens one passed as an argument, checks it with `sanitizeUrl` on its context. See [How to Restrict URLs with a URL Security Policy](../url-security/) for the full rules and the SDKs that support them.

```json
"imageUrl": {
"$ref": "common_types.json#/$defs/DynamicString",
"x-a2ui-url-context": "media"
}
```

### Schema parity tests in CI

When your backend agent loads `status_catalog.json` and your client defines schemas in code (with Zod, `json_schema_builder`, `JSONSchema`, or `A2uiProperty` and `A2uiSchema`), avoid comparing serialized JSON files as raw strings. Code-built schemas and hand-authored JSON files often differ in key order, `$schema` or `instructions` fields, and localized `#/$defs/...` pointers inside `validationSchema`.
Expand Down
Loading
Loading