Give it the right context
Paste this and fill in the brackets. An agent that starts with this much context asks fewer clarifying questions and guesses at fewer fields.Make it verify, not guess
Add whichever of these lines apply to the task. Each tells the agent to check something live instead of assuming it.- Fetch the live spec for the exact endpoint before writing code (
https://api.yield.xyz/docs.json, oryield_get_api_specif connected); do not reuse field names from an old answer or a training-data memory of the API. - Read
mechanics.arguments.enter/.exit.fields[]fromGET /v1/yields/{yieldId}instead of hardcoding arguments. See Yield metadata. - Confirm
status.enter/status.exiton the yield before building an enter or exit action; a closed yield returns412, not a validation error. - Iterate
transactions[]bystepIndexand respectexecutionPattern(synchronouswaits for each confirmation;batchbundles multiple operations into one transaction).asynchronousis also a declared value, but current actions returnsynchronousorbatch. See Actions. - Submit the hash, or submit the signed transaction, exactly once per transaction:
PUT /v1/transactions/{id}/submit-hashafter you broadcast, orPOST /v1/transactions/{id}/submitto have Yield.xyz broadcast. Never both for the same transaction. - Poll
GET /v1/transactions/{id}orGET /v1/actions/{id}to a terminal status; don’t assume success right after a broadcast. - Read balances and
pendingActionsbefore a manage call. See Balances and positions. - Check network and provider availability for this project through discovery (
GET /v1/networks,GET /v1/providers,GET /v1/yields) rather than assuming a network or protocol is enabled.
Prompt patterns
Discover yields, with pagination
Enter a position
Exit a position and claim a pending action
Portfolio balances across networks
Debug an API error
Review before anything signs
Never sign a generated transaction without inspecting it yourself. This applies whether the transaction came from a builder plugin, a one-off prompt, or code you wrote by hand. For generated code, check:- Every request goes to
https://api.yield.xyzwithx-api-keyfrom an environment variable; no key literal in source. - Action arguments came from the yield’s schema, not copied from another yield or from memory.
- Amounts are human-readable decimal strings, never wei.
transactions[]are processed instepIndexorder, and nothing modifiesunsignedTransaction.
- Inspect the decoded
toaddress, amount, and network yourself; don’t trust a summary the agent wrote. - Confirm it targets the yield and action you asked for, not a different one.
- Run a small test amount first, on a network where a mistake is cheap.
manage action, are in Guardrails.
Anti-patterns
- Asking for “the best APY” with no network, asset, or risk scope: the agent will invent a ranking instead of querying one.
- Letting the agent pick a
yieldIdfrom memory instead of discovering it from your project’s enabled yields. - Asking the agent to “fix” a failed transaction by editing the returned payload. Request a new action instead; a modified
unsignedTransactioncan send funds to the wrong place.
Next steps
AgentKit builder
Install the plugin that applies these patterns automatically while it writes your integration.
AI coding tools
Connect your agent to the live docs, spec, and MCP doc tools these prompts rely on.
Enter and exit flows
Build the same flow by hand, endpoint by endpoint, to check what an agent generated.
Guardrails
The non-custodial rules an agent or generated integration must follow.

