Documentation
¶
Overview ¶
Package prompt provides template rendering for agent system prompts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderAgentPrompt ¶
RenderAgentPrompt renders the execution agent system prompt with the given data, filtering tools/connections/MCPs/topics/routes that the caller's access level cannot reach. callerAccess of "" means "render the unfiltered admin variant" — callers that want explicit gating must pass "admin", "user", or "public" by name. Filtering is necessary because the rendered prompt is cached and reused per-run; without it, public callers would learn about admin-tier surface in the system prompt even though the VM blocks the call at runtime.
Types ¶
type AgentData ¶
type AgentData struct {
AgentDashboardURL string // e.g., "https://airlock.example.com/agents/{id}"
AgentRouteURL string // e.g., "https://myagent.dev.airlock.run"; required (always non-empty)
Tools []ToolInfo
Connections []ConnInfo
Topics []TopicInfo
Webhooks []WebhookInfo
Crons []CronInfo
Routes []RouteInfo
MCPServers []MCPServerStatus
}
AgentData is the template data for rendering the execution agent system prompt.
type MCPServerStatus ¶
type MCPServerStatus struct {
Slug string
Name string
Status string // e.g. "connected, 5 tools" or "requires authentication"
Access string // registered access level — filters this server out of non-matching prompt variants
// Tools is empty when the server isn't authorized or discovery hasn't run.
// When populated, the template renders a typed `declare const mcp_{slug}: {...}`
// block alongside the status line.
Tools []ToolInfo
}
type ToolInfo ¶
type ToolInfo struct {
Name string
Description string
LLMHint string
Access string
InputSchema json.RawMessage
OutputSchema json.RawMessage
}
ToolInfo carries the hydrated tool record for prompt rendering. InputSchema and OutputSchema are JSON-encoded JSON Schemas. LLMHint is optional model-only guidance that pairs with Description (which surfaces in the dashboard's Tools tab); see agentsdk.Tool.LLMHint. Access is the registered access level ("admin"/"user"/"public") used by RenderAgentPrompt to filter the surface for non-admin callers — public runs must never see admin-only tools listed in the prompt, even though the VM also blocks the call at runtime.