# <System />

Add resolved instruction text to the nearest <Agent /> system prompt in authored order.
Canonical: https://agent-markup-language.com/docs/reference/primitives/system/
Documentation index: https://agent-markup-language.com/docs/
Complete documentation: https://agent-markup-language.com/docs/llms.txt

`<System />` routes resolved child text into the system channel of its nearest containing [`<Agent />`](https://agent-markup-language.com/docs/reference/primitives/agent/). It does not open a provider session itself.

```tsx
import { Agent, AmlRuntime, System } from "@aml-jsx/sdk"
import { DeterministicAgentProvider } from "@aml-jsx/sdk/testing"

const provider = new DeterministicAgentProvider({
  respond: request => ({ text: request.system }),
})

const runtime = new AmlRuntime({
  agentProvider: provider,
  system: "Follow application security policy.",
})

const system = await runtime.evaluate(
  <Agent system="Act as a code reviewer.">
    <System>Report only evidence you can identify.</System>
    Review the patch.
  </Agent>
)
```

The provider receives system text in this order: runtime `system`, `<Agent />` `system`, then child `<System />` blocks in authored order. Empty fixed fragments are omitted and the remaining fragments are joined with newlines.

## Props

| Prop       | Type            | Default | Meaning                                     |
| ---------- | --------------- | ------- | ------------------------------------------- |
| `children` | `AmlRenderable` | empty   | Any AML value that resolves to system text. |

## Composition rules

- `<System />` is valid only inside its nearest `<Agent />` plan.
- A child `<Agent />` inside `<System />` runs first; its final text becomes system text for the parent `<Agent />`.
- Multiple `<System />` blocks preserve authored order.
- `<System />` changes the message channel, not provider selection, Sandbox authority, or Tool scope.

Use [`<Include />`](https://agent-markup-language.com/docs/reference/primitives/include/) for reusable instruction files, [`<Skill />`](https://agent-markup-language.com/docs/reference/primitives/skill/) for a complete Agent Skills package, and [`<FollowUp />`](https://agent-markup-language.com/docs/reference/primitives/follow-up/) for later user turns in the same session. A Skill is session-wide and must be declared in the Agent plan rather than inside `<System />`.
