cxas-self-steering-agent

cxas-self-steering-agent is a skill for Claude Code, Codex from GoogleCloudPlatform/cxas-scrapi. It costs 153 tokens per session (7,789 once invoked), scanned A, original, Apache-2.0.

A development guide for self-steering CXAS conversational agents used in chat or voice. These are support-style agents that manage the conversation themselves, using task instructions, available tools, and session state.

In plain words
What is it for?
Use it to build or refactor these agents, scaffold an application from the sample, check which tools are visible, run tools locally, and test conversations against a deployed app.
Why use it?
It gives a defined way to organise a conversational agent without adding a separate controller that makes decisions behind the model. It also provides checks and local or deployed conversation runs for finding setup mistakes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; installed under .agents/ (shared by several agents).

Good fit Use it to build or refactor these agents, scaffold an application from the sample, check which tools are visible, run tools locally, and test conversations against a deployed app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add GoogleCloudPlatform/cxas-scrapi --skill cxas-self-steering-agent
Clone the repo
git clone --depth 1 https://github.com/GoogleCloudPlatform/cxas-scrapi

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cxas-self-steering-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent/github.svg)](https://agentmods.dev/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent)
Your own site
<a href="https://agentmods.dev/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent"><img src="https://agentmods.dev/badge/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cxas-self-steering-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent"><img src="https://agentmods.dev/badge/skills/googlecloudplatform/cxas-scrapi/cxas-self-steering-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 153 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,789 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00153 $0.07789
Opus 5.5 $0.00061 $0.03116
Sonnet 5.5 $0.00031 $0.01558
Haiku 4.5 $0.00015 $0.00779

Measured 4d ago against content hash 5ae7fe386c9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cxas-self-steering-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 20 executable files (resources/sample-agent/agents/Support_Agent/before_model_callbacks/before_model_callbacks_01/python_code.py, resources/sample-agent/tools/check_return_pickup_availability/python_function/python_code.py, resources/sample-agent/tools/create_mail_return/python_function/python_code.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/cxas-self-steering-agent/SKILL.md · 516 lines

How it starts

The opening of the file, as written. The whole thing — 516 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CXAS self-steering agent

This skill builds self-steering CXAS agents. Treat the model like a capable person on a support team: give it the power to run the whole conversation and the awareness to know where it is and why, and set up its job so it can do both. There's no steering agent and no code making decisions behind the model's back; the agent steers itself. Progressive disclosure and deterministic actions are the two main techniques, built from a Jinja instruction template, Python tools, session state and one small callback on top of the loop CXAS runs.

The skill bundles a working sample agent (resources/sample-agent) and these scripts:

  • scripts/scaffold_from_sample.py copies the sample into a new app directory.
  • scripts/check_tool_visibility.py renders the instruction for every playbook and task, lists the tools the model can see, and catches template and tool anti-patterns that cxas lint misses.
  • scripts/sync_tool_descriptions.py copies tool docstrings into the tool JSON files.
  • scripts/run_locally.py runs tools and the callback on your machine.
  • scripts/run_conversation.py runs a test conversation against the deployed app.

Read references/guide.md before designing or changing an agent. It has the reasoning, the code patterns, and the platform gotchas.

Before you start

  • Install the CXAS SDK and CLI, which also brings in jinja2: pip install cxas-scrapi (use the workspace's virtual environment if it has one).
  • Creating an app, pushing and testing call the CES API, so log in first: gcloud auth application-default login. Building and checking locally don't need it.
  • Know the GCP project and CES location (for example us) the app lives in.

Rules

  1. The model steers the conversation. Treat it like a capable person on a support team. It makes every conversational decision: what the customer needs, which playbook to open, what to ask, which tool to call, when to read a disclosure, and when to hand off or say goodbye. Give it the power to act (a tool for everything the agent might do, including ending the conversation and transferring) and the awareness to act well (where it is, what it can do right now, and why it did what it did before). Code never makes a conversational decision behind its back: never run regex, keyword, or substring checks on customer utterances or model replies in callbacks or tools to decide intent, trigger transfers, or override tool arguments. Give tools explicitly typed parameters (bool for confirmations, int/float for counts, Literal[...] for closed sets, Optional[...] = None for optional fields) so the model classifies what the customer meant, and only validate argument formats (digit count, date format) in tool code.
  2. One root agent, no sub-agents. A sub-agent handoff reaches the model as transfer_to_agent(agent_name: "...") plus history lines like [Other Agent] said: ..., so the model announces "transfers" the customer never asked about. Keep one agent and swap task instructions inside it.
  3. Progressive disclosure. instruction.txt is a series of flat top-level blocks, static ones first: <role>, <constraints>, <anytime_actions> and <playbook_list>. Then come the blocks that depend on state: <task_list> (the open playbook's tasks, rendered whenever current_playbook is set), <status> (today's date, the open playbook and the loaded task), and one chain for the loaded task: <pending_handoff> if a tool can decide on a transfer, a shared prerequisite block such as <identify_order> if the tasks start with the same steps, and otherwise <playbook_rules> (rules every task in the playbook shares, such as switching tasks or records) followed by one <task name="..."> block. Never hide <playbook_list> once a playbook is open or <task_list> once a task is loaded; the model needs both to switch when the customer changes the subject or has a second request. When several tasks start with the same steps (finding and verifying the record), write them once instead of copying them into every task. Choose per agent between a shared prerequisite block, which renders in place of the task's steps while the task stays loaded, and a separate task the model loads first and then comes back from. The block saves two router calls per request and keeps the customer's task in <status>; a separate task fits a long identification flow with its own rules, or one the customer asks for on its own ("help with a different order"). Always build both layers, open_playbook and load_task, even for a small agent. Group related use cases into a playbook with a few tasks (a playbook with one task is fine), and keep each list short so the model never picks from a long menu.
  4. Router tools. open_playbook(playbook_name, rationale) and load_task(task_name, rationale) check exact names (no aliases), return structured status and the valid names on a miss, and set the state variable. open_playbook clears current_task. The required one-sentence rationale stays in the history so later turns know why the step happened. Routers write only current_playbook and current_task: they never set or clear domain state (the tool that changes a record clears what depended on it, so a stray reload can't wipe a verified record) and never read rationale. If routing needs context, such as "this is about the order from the greeting", put a typed flag on the domain tool that uses it.
  5. Branch with Jinja, not prose, and render one step at a time.
    • Use double-brace control tags ({{% if ... %}}, {{% elif ... %}}, {{% else %}}, {{% endif %}}) so the model sees only the branch that applies without injecting <state_update> blocks into the conversation history.
    • Give every <task> block the same shape: optional <task_rules> (rules for every step of this task, including do's and don'ts that only apply here), an optional <collected> list of confirmed facts in plain sentences (never unverified on-file records or a raw <session_snapshot> variable dump), and a <current_step> block with one flat {{% if ... %}} / {{% elif ... %}} chain, so only the active unfinished step renders on any model call. A short task whose steps have no irreversible action or word-for-word script can list its steps together in one step; gate a step whenever it leads to a submit-style tool or a script, so the model can't reach it early.
    • Steps gate instructions and irreversible actions, not corrections. The chain is computed from state on every model call, so going back means calling a tool that changes an earlier answer, and the earlier step then renders again on the next call. Put every tool that changes an earlier answer (a lookup that switches the order, an update_... intake tool) and every read-only lookup a customer may ask for early in <task_rules>, so it's visible at every step. Keep only submit-style actions and word-for-word scripts inside their own step. An edit tool named only in its own step gets called anyway from the history, and CES fails the turn with "unexpected function call".
    • Every edit clears what depended on the old value (switching orders clears the old order's verification and collected details, and changing a booking detail resets summary_confirmed), so the chain goes back to the first step that needs redoing instead of skipping it. Clear only what depended on it: never reset an attempt counter outside the tool that verifies (the sample counts ZIP failures for the whole conversation, so switching orders can't start the count over), and scope every done flag to its record by storing the record's ID or clearing the flag when the record changes.
    • A step that asks the customer to confirm or choose says "and end your turn", so the model waits instead of answering for them. Never call a selection or submit tool in the same turn as the lookup that produced the choices.
    • Every done step says what can still change and with which tool, or, when the agent has no tool for it, that it can't and what to offer instead. Without that line the model improvises, for example transferring without asking or making up why a change isn't possible.
    • Never write prose state checks (If zip_verified is false...) on session state variables; branch with {{% if ... %}} instead. Only fields of the current step's tool result (If it returns invalid_zip...) belong in prose inside that step.
    • In output tags, CES only substitutes bare variables ({{var}}, {{a.b}}), never expressions like {{ x or "none" }} or {{ "a" if c else "b" }} (which CES sends to the model as literal code) and never single-brace {var}. Never put {{var}} inside tool-call examples (f(arg='{{x}}')) where an empty x renders as f(arg=''), and never write realistic sample confirmation codes (such as NQAA123456) in instructions or docstrings because the model can read them aloud to customers as real data.
    • Do not put {{# ... #}} or {# ... #} comments in instruction.txt: the platform leaves them in the prompt sent to the model and callback.
  6. Tools return facts and status codes, never instructions, full-state echoes, or unmasked secrets.
    • Facts the agent shares (order details, dates, confirmation codes) come back in a tool result, not only in the rendered instruction. A step may also show them from state, but when the only source was the instruction, gemini-composite-v2 sometimes invented a lookup tool to fetch them and failed the turn.
    • Tool responses stay in llm_request.contents for the rest of the conversation. Never return prose coaching keys (message, instructions, next_step_guidance, wrap_up_guidance) telling the model what to say or do next; put behavior rules in instruction.txt.
    • Intake/update tools (update_...) return only the fields updated in that call (plus not_recorded when co-batched fields were skipped because an earlier gate wasn't complete), never a full state dump.
    • Keep unverified on-file data (such as order.on_file_zip or full account numbers) in session state for verification tools to check, and return only verified flags or masked values (such as last4) to the model. The sample's lookup_order returns only whether the order exists, and verify_order_zip returns the order's details once the ZIP code matches.
    • Build results from named fields. Never return a raw backend payload or spread one into the result (**data), and fail closed on backend data: eligibility flags default to False, and success needs an explicit positive field.
    • When the customer picks one of several looked-up records, the tool that selects it takes the ID, matches it only against the records the lookup stored in state, and on a miss returns what the agent may read out (such as masked labels), not the full list of IDs.
    • Final action tools (submit_cancellation, submit_return_pickup) read the target ID and collected fields from validated session state rather than trusting LLM-copied arguments, fail closed when prerequisites are missing, and accept the final confirmation flag (confirmed=True or summary_confirmed=True) directly so a single-turn confirm-and-submit call cannot race. Reset summary_confirmed when any booking detail is edited, and check the completed state near the top of the step chain so resetting summary_confirmed after booking can't bring the summary step back. Once the action is done, an intake tool must not change the collected details on its own, or state drifts from what was submitted: either refuse (the sample returns pickup_already_booked because it has no way to change a booking), or, if the backend can change a submitted request, add a tool that changes it there and updates state in the same call, and name that tool in the done step.
  7. Few session variables, grouped by the tool that writes them. Every slot, flag and counter declared as its own top-level variable makes an app grow by hundreds of variables that are hard to read, review and migrate.
    • Store only what a {{% if %}} branch, a rendered fact or a later tool needs. Don't copy into state what a tool result already gave the model, and don't add a flag for something a branch can test directly.
    • Each tool that writes several values keeps them in one OBJECT variable that only it writes: the record a lookup tool found (the sample's order), the slots an intake tool collects (return_details), the result of a submit tool (return_pickup). A tool that writes one value can keep a flat variable. So objects are capped by the number of tools that write state.
    • Never let two tools write the same variable. In the default PARALLEL tool execution mode, tools the model calls in the same step all start from the same state, and each write replaces the variable's whole value, so one write is lost. A per-playbook object written by every tool in the playbook loses writes this way.
    • Instead of having one tool reset another tool's state when the record changes, store the record's ID with the state and compare it: zip_check.verified_order_id == order.order_id, return_details.order_id == order.order_id. State from another order simply stops matching.
    • Keep variables flat for routing (current_playbook, current_task), the skill's plumbing (next_agent_actions, played_greeting, pending_handoff_reason, handoff_summary), and keys another system reads as session parameters, such as reporting or telephony keys. Make those STRING, since get_session_params ignores objects and non-strings. If two tools that never run in the same step set one of those keys, list it under V105 ignore in cxaslint.yaml.
    • cxas lint reports a variable written by more than one tool in PARALLEL mode (V105, a warning) and a tool writing several flat variables (V106, info). Lint still passes with them, so fix every V105.
    • Data loaded at session start that no tool owns goes in one object only the session-start or before_model callback writes. before_tool and after_tool callbacks run per tool call and race like tools, so V105 counts them as writers. Eval mocks go in one read-only object.
    • Declare each OBJECT with properties (a type for each) and a default that lists every property, so the instruction never reads a missing key and cxas lint (V100 to V104) catches a misspelled property or a name left over from a flat layout.
    • The owning tool reads the object, changes it and writes the whole object back; never change a nested value in place. Numbers inside objects come back as floats, so cast counters with int(). The instruction uses dot access: {{% if return_details.reason %}}, {{order.order_id}}.
  8. Anytime actions. <anytime_actions> is static and names {@TOOL: graceful_end_session} and {@TOOL: execute_live_agent_handover} (plus any other action that must work from any state, such as a transfer to another language), so the agent can end the conversation or transfer in one model call from any state without opening a playbook. Rules for these tools live only here, never in <role> or <constraints>, so each trigger has one rule. If a playbook sends transfers somewhere else, gate the anytime line off with {{% if %}} instead of writing "follow the playbook's rule instead". execute_live_agent_handover takes a required conversation_summary (what the customer wanted, what was done, what's still open) for the representative. <anytime_actions> also holds the wrap-up rule: ask whether there's anything else once the customer has what they asked for, and give a next step first when the agent couldn't help. When a tool decides a transfer is required (such as after too many verification mismatches), it sets pending_handoff_reason in state. The first branch of the task chain, {{% if pending_handoff_reason %}}, then renders a <pending_handoff> block in place of the task, so the model gets one instruction (transfer now) rather than a transfer rule next to a task step, and execute_live_agent_handover reads and clears pending_handoff_reason. <anytime_actions> also holds a catch-all: when the customer wants a change that no playbook or task covers, the model says so and offers a representative instead of calling a tool that isn't in its list. Keep the catch-all free of domain examples. It's static, so an example like "such as changing a submitted request" tells the model that submitted requests can't change, even in an agent that has a tool for it. Say what can't change in the done step where it's true.
  9. Dynamic tool hiding. The callback hides every tool whose name has no word-boundary match in the rendered instruction. Only open_playbook and the tools named in <anytime_actions> may be named in static text. Name a tool only as {@TOOL: name} and only where the model may call it; a bare name in prose ("the lookup_order result") shows the tool in that branch too. Never put a tool name in a tag name (<end_session> would expose the built-in end_session tool on every turn) or an unstripped comment, never give a playbook or task the same name as a tool, and mention a tool in every branch where the model may need it. Keep the "Your tool list only has the tools for the loaded task..." rule at the end of <task_list>.
  10. Deterministic actions only where they matter. Use code for the greeting, for text that must be word for word (a tool that sets a state flag and queues a customized_response through set_next_agent_actions), and for the goodbye and live agent handoff (a tool that queues the message together with end_session). The model still decides when to call the tool, the result says what happened, and the text lands in the history as the agent's own reply. A tool never returns text for the model to repeat (phrase, script, "say it exactly as returned"), and only the goodbye and handoff tools queue end_session. Don't chain workflow steps inside tools or switch current_task from code; later turns can't explain actions their instructions don't mention.
  11. One small callback. A single before_model_callback runs _handle_next_agent_actions, _handle_initial_greeting, and _handle_dynamic_tool_hiding, in that order. Never add after_model_callbacks to inspect or rewrite model replies, and never append dynamic rule blocks to system_instruction in before_model_callback (gate rules with {{% if ... %}} in instruction.txt instead).

Read the full file on GitHub · 516 lines

Files

What ships with it

40 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +249 lines 5ae7fe386c9b
  2. 19d ago First seen · 267 lines · 153 tokens per session scan A d6d89243ff24

Subscribe to this mod's changes

cxas-self-steering-agent is a skill published in the GitHub repository GoogleCloudPlatform/cxas-scrapi (121 stars, last pushed today), licensed Apache-2.0. It adds 153 tokens to every session and 7,789 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-12.

Related

cxas-self-steering-agent compared with skills from other repositories

cxas-self-steering-agent next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cxas-self-steering-agentGoogleCloudPlatform/cxas-scrapiSkill121todayApache-2.0A153Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill331k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144kyesterdayMITA95Claude Code