Skip to main content
AgentConfig.Instruction accepts an agents.SystemPromptProvider. For a static instruction, use hastekit.NewPrompt("..."). A prompt created without resolvers is used exactly as written. Templates, skill descriptions, handoff guidance, sub-agent descriptions, and connector status are not appended automatically.

Enable the standard resolvers

Import github.com/hastekit/agent-sdk-go/pkg/agents/prompts and configure:
Supply the matching value in Input.RunContext, for example map[string]any{"name": "Sam"}. The template resolver operates on the run context. Treat instructions and their template structure as application configuration; do not splice untrusted text into a system instruction as executable template syntax. The standard chain runs in this order:
  1. ResolveSkills: advertise the configured skills and how to read them.
  2. ResolveHandoffs: describe available handoffs.
  3. ResolveDeferredTools: explain tools available through discovery.
  4. ResolveConnectors: report MCP connector availability.
  5. ResolveSubAgents: describe the available delegation targets.
  6. ResolveTemplate: substitute run-context values in the assembled prompt.
prompts.WithResolver appends to the chain. You can select individual resolvers or add one after the defaults. Omitting a resolver is appropriate only when your prompt already supplies the corresponding guidance.

Load a prompt from your own source

Implement the loader interface and pass it to NewPromptWithLoader:
The loader receives a context and can retrieve the prompt from your own storage. Handle network errors and version selection there. Resolver functions use the signature func(string, *agents.Dependencies) (string, error) and process the loaded string in order. For a complete replacement, implement agents.SystemPromptProvider.GetPrompt(ctx, deps). The SDK does not automatically apply SimplePrompt resolvers to your custom provider.

Durable execution

Prompt retrieval and its middleware execute inside the runtime’s durable execution boundary. Keep a deployed prompt version stable for work that needs reproducibility, and expect the underlying step to be called again if it retries. Avoid relying on process-local mutable state to choose a prompt version.