Skip to main content
connic
Build

Agent YAML

Agent YAML fields, plus the syntax for prompts, tools, and conditional configuration.

Last updated

Configuration fields

FieldTypeStatusDescription
versionstringRequiredConfiguration schema version. Must be '1.0'.
namestringRequiredUnique agent identifier. Use lowercase letters, numbers, and hyphens.
typestringOptionalAgent type: llm, sequential, or tool. See Agent Types.Default: llm
descriptionstringRequiredHuman-readable description of what the agent does.
modelstringOptionalPrimary AI model. Required for LLM agents. See Models and Providers.
fallback_modelstringOptionalModel used after a failed primary request, while time remains and no output from that request has been delivered. Configured context repair runs first. See fallback behavior.
system_promptstringOptionalInstructions for LLM agents. Use YAML's pipe character for multiple lines.
toolslistOptionalTools loaded into an LLM agent context. Supports strings, condition mappings, and wildcard patterns. See Conditional Tools. Maximum 100 per agent, including generated approval.inputs tools. MCP server tools and discoverable_tools do not count.Default: []
discoverable_toolslistOptionalTools indexed for on-demand discovery instead of loaded up front. Uses the same strings, conditions, and wildcards as tools. See Discoverable Tools.Default: []
agentsstring[]OptionalAgent names to execute in sequence. Required for sequential agents.Default: []
tool_namestringOptionalCustom tool executed directly by a tool agent. Use its exact dotted module path. Predefined and api: tools are not allowed.
max_concurrent_runsintegerOptionalMaximum simultaneous runs, capped by the subscription plan. See Runtime Controls.Default: 1
temperaturenumberOptionalControls randomness in LLM output. Lower values are more deterministic.Default: 1
reasoning_effortstringOptionalUse auto for model-managed behavior. Supported overrides vary by model; see the connic model catalog or the BYOK provider documentation.Default: auto
reasoning_budgetintegerOptionalRaw reasoning-token budget for models that accept an explicit budget. Use reasoning_effort for models with named effort levels.
retry_optionsobjectOptionalControls attempts, request timeouts, and backoff for all LLM request failures without replaying the agent. Tool and sequential agents retain operation-level retries.
attemptsintegerOptionalMaximum normal attempts, including the first. Without fallback, the primary gets this budget. With fallback, the primary gets one attempt and the fallback gets this budget. Context repair can add one same-model request per logical call. For non-LLM agents, the budget applies to the operation. Range: 1–10.Default: 3
attempt_timeoutnumberOptionalPositive, finite time limit in seconds for each LLM completion or whole stream, capped by the run’s remaining time. Incoming chunks do not reset it. Retries share the original run deadline.Default: 120
initial_delaynumberOptionalInitial generated backoff in seconds. Same-model LLM retries use exponential backoff with equal jitter unless the provider sends a valid Retry-After. Switching to fallback is immediate.Default: 10
max_delaynumberOptionalMaximum generated backoff in seconds. A valid Retry-After overrides generated backoff; all waits remain bounded by the run deadline. Maximum 300.Default: 30
rerun_middlewarebooleanOptionalRe-run before middleware for operation retries on tool and sequential agents. It has no effect on LLM agents.Default: false
timeoutintegerOptionalMaximum execution time in seconds. Minimum five seconds and always capped by the subscription limit.
max_iterationsintegerOptionalMaximum LLM loop iterations per run. Prevents infinite loops and excessive resource use.Default: 100
guardrailsobjectOptionalInput and output safety rules for LLM agents. See Guardrails.
inputobject[]OptionalRules applied to raw input before middleware and agent execution.
outputobject[]OptionalRules applied to the response before it is returned.
run_after_on_blockbooleanOptionalWhether after middleware runs when an input rule blocks the request.Default: true
typestringRequiredGuardrail type: prompt_injection, pii, moderation, topic_restriction, regex, pii_leakage, system_prompt_leakage, relevance, data_exfiltration, or custom.
modestringOptionalblock, warn, or redact. Redaction is only supported for pii and pii_leakage.Default: block
namestringOptionalGuardrail module name. Required when type is custom.
configobjectOptionalPer-rule options including messages, fail_run, entities, patterns, provider, sensitivity, and model.
rejection_messagestringOptionalMessage returned when a rule blocks. Falls back to off_topic_message.
off_topic_messagestringOptionalMessage for topic_restriction blocks and fallback for rejection_message.
fail_runbooleanOptionalWhen true, a block marks the run failed. Otherwise it returns a completed response with the rejection message.Default: false
output_schemastringOptionalJSON Schema filename from schemas/. Constrains LLM output to the schema. See Output Schema.
databaseobjectOptionalDatabase tool access controls. Omit for unrestricted database access.
collectionsstring[] | objectOptionalRestrict access to named collections. The mapping form supports per-collection prevent_delete and prevent_write overrides.
prevent_deletebooleanOptionalBlock db_delete. A collection override can replace this value.Default: false
prevent_writebooleanOptionalBlock db_insert, db_update, and db_upsert. A collection override can replace this value.Default: false
retrievalobjectOptionalRetrieval tool access controls. Omit for unrestricted retrieval access.
namespacesstring[] | objectOptionalRestrict access to named namespaces. The mapping form supports per-namespace prevent_delete and prevent_write overrides.
prevent_deletebooleanOptionalBlock retrieval_delete. A namespace override can replace this value.Default: false
prevent_writebooleanOptionalBlock retrieval_store. A namespace override can replace this value.Default: false
filesobjectOptionalFile tool access controls. Omit for access to the whole file tree. See File Tools.
foldersstring[] | objectOptionalRestrict access to these folders and everything below them. The mapping form supports per-folder prevent_delete, prevent_write, and session_only overrides.
prevent_deletebooleanOptionalBlock file_delete. A folder override can replace this value.Default: false
prevent_writebooleanOptionalBlock file_write and file_update. A folder override can replace this value.Default: false
session_onlybooleanOptionalShow the agent only files written in its current session. Requires session. A folder override can replace this value.Default: false
mcp_serversobject[]OptionalExternal MCP servers. Maximum 50 per agent. See Use MCP Servers.
namestringRequiredMCP server identifier.
urlstringRequiredMCP server endpoint URL.
toolsstring[]OptionalOptional filter of tools to load. Omit to use every server tool.
headersobjectOptionalAuthentication headers. Supports variable interpolation with ${VAR} and per-run interpolation with ${context.*}.
discoverablebooleanOptionalIndex tools from this server for on-demand discovery rather than loading them up front.Default: false
bridgestringOptionalBridge ID for routing to a private server. Supports ${VAR} interpolation.
conditionstringOptionalConnect the server only when this expression is true for the run. Uses the conditional tools grammar.
optionalbooleanOptionalContinue the run without this server when connecting or listing its tools fails. See Conditional and Optional Servers.Default: false
concurrencyobjectOptionalOne active run per resolved key. Not supported on sequential agents. See Concurrency Rules.
keystringRequiredDot path used to extract the key from the trigger payload.
on_conflictstringOptionalqueue waits for the active run; drop cancels the new run; coalesce keeps one waiting run per key and replaces it with newer events.Default: queue
approvalobjectOptionalHuman approvals and input tools. See Approvals.
toolslistOptionalExisting tool references that require a yes/no decision. A mapping value can condition approval with param.* and context.* expressions.Default: []
inputslistOptionalLLM agents only. One-key mappings from an ASCII identifier of at most 64 characters, such as get_mfa, to prompt, label, and optional params and sensitive. Names must be unique, cannot use reserved tool-discovery names, and cannot collide with tools, discoverable_tools, or approval.tools. connic creates each tool automatically; generated input tools count toward the 100-tool agent limit.Default: []
promptstringRequiredNonblank tool description shown to the agent, explaining when to request human input.
paramslistOptionalOne-key mappings from unique ASCII identifiers to str, int, float, or bool. Python keywords and context are not allowed as names. The agent must supply every declared parameter; extra arguments are rejected. Values appear as context above the human input field. Omit for a tool with no arguments.Default: []
labelstringRequiredNonblank label of at most 200 characters shown above the human input field.
sensitivebooleanOptionalMask the input and protect stored response data. The model still receives the tool result; see Approvals for the protection scope.Default: false
timeoutintegerOptionalSeconds to wait for a decision. Range: 30–604800.Default: 3600
messagestringOptionalCustom message shown to the reviewer.
on_rejectionstringOptionalfail terminates the run; continue returns a rejection message to the LLM so it can adapt.Default: fail
sessionboolean | object | nullOptionalSet true for one shared session across the agent’s runs, or use an object to configure it. False, null, or omission disables sessions. See Persistent Sessions.
keystring | nullOptionalOptional context.* or input.* path that resolves the session ID. Omit or set null to share one session across the agent’s runs.
ttlinteger | nullOptionalSession expiry after this many inactive seconds. Minimum 60; omitted or null means no expiry.Default: null
historybooleanOptionalRetain conversation history across runs. False starts each run with fresh chat history.Default: true
browserbooleanOptionalRetain browser cookies and local storage across runs. False keeps browser tools available with fresh browser state.Default: true
context_compressionobjectOptionalShortens long LLM conversation history. Context-window errors trigger compression before fallback and allow one extra request to the same model. See context repair limits. Omit to keep compression off.
enabledbooleanOptionalEnable compression when the block is present.Default: true
modelstringOptionalOptional model used only for compression summaries. Defaults to the agent model.
max_prompt_tokensintegerOptionalPrompt-token threshold that can trigger compression before a provider context-window error.
keep_recent_messagesintegerOptionalRecent messages kept verbatim when compression runs.Default: 8
session_historyobjectOptionalOptional stored-history compaction between runs. Omit to keep it off.
intervalintegerOptionalCompact older stored history after this many runs.
keep_recent_runsintegerOptionalRecent runs left unsummarized during stored-history compaction.Default: 1
voice_configobjectOptionalEnable native realtime audio for an LLM agent, using its model, prompt, and tools. See Voice configuration.
voicestringOptionalVoice ID accepted by the selected provider. Omit to use its default voice.
languagestringOptionalPreferred spoken language, such as en or de-DE. Added to the model instructions and used as a transcription hint where supported; it does not force recognition into that language.
transcription_modelstringOptionalOpenAI model name for transcribing user speech, or an existing transcription deployment name in the same Azure resource. Omit to disable user transcription for OpenAI and Azure. Gemini and Vertex AI use native transcription without this setting.
greetingstringOptionalOpening greeting requested from the model. Omit to let the user speak first.
thinking_soundbooleanOptionalPlay a quiet repeating tone during tool waits or provider-reported background work. Pauses while the user or agent speaks.Default: true
hang_up_allowedbooleanOptionalAllow the agent to end the conversation itself. A spoken farewell plays in full before the conversation ends. Set false to disable this ability.Default: true
turn_detectionobjectOptionalControl detection of when the user has finished speaking.
silence_msintegerOptionalSilence duration in milliseconds before ending the user's turn. Must be greater than zero. Omit to use the provider default.
interruptionsobjectOptionalControl whether user speech interrupts the spoken response. Interruptions are enabled when this object is omitted.
enabledbooleanRequiredWhether the user can interrupt the agent. Required when interruptions is present.
idle_timeout_secondsintegerOptionalEnd the voice session after this many seconds of conversational inactivity. Tool execution and provider-reported background work keep the session active. Must be greater than zero. Omit for no voice-specific idle timeout; the run timeout still applies.
keypadobjectOptionalMap keypad keys (0-9, *, #) to tools listed in tools. A key press runs its tool without a model turn; the tool cannot have required parameters.
Required fields by type

All agents: version, name, and description

LLM: + model and system_prompt · Sequential: + agents · Tool: + tool_name

Writing system prompts

agents/agent.yaml
system_prompt: |
  This is a multi-line system prompt.

  You can write multiple paragraphs here.
  The pipe character (|) preserves newlines.

  Use this for complex instructions.

Referencing tools

agents/agent.yaml
# Reference tools by exact module path under tools/
tools:
  - search.web_search            # tools/search.py -> web_search()
  - billing.calculator.add       # tools/billing/calculator.py -> add()
  - email.send_notification      # tools/email.py -> send_notification()
  - billing.*                    # all public functions in tools/billing.py
  - support.search_*             # functions starting with search_ in tools/support.py

Tools are Python functions in tools/. Top-level modules use references like calculator.add; nested modules use their full dotted path. See Write Custom Tools.

A wildcard * matches a sequence of characters. billing.* includes every public function in tools/billing.py, while support.search_* includes matching functions. Wildcards also work with API spec tools. A wildcard without a dot matches predefined tool names; for example, db_* includes every predefined database tool. Deployment fails if a wildcard matches nothing.

Conditional tools

Use a mapping from tool reference to expression to make a tool available only when the expression is true. A false condition removes the tool for that request.

agents/agent.yaml
# Conditional tools use Python expression syntax.
tools:
  - calculator.add
  - calculator.multiply: context.multiply_allowed
  - web_search: input.search_enabled
  - admin.dangerous_tool: input.role == 'admin' or context.admin
  - premium.tool: input.tier == 'pro' and context.feature_on
  - optional.tool: not context.disabled
Expression Syntax

Python-like syntax: and, or, not; comparisons == != > < >= <=; membership in, not in; parentheses for grouping; string literals in single or double quotes. Reach into nested objects with dot-paths like context.user.role. A bare path like context.active is a truthy check: it passes when the value is set and not empty, zero, or false. Missing fields make the surrounding predicate fail rather than raising.

context.<key>
Values from the run context, including middleware values and connic-provided run metadata. Nested paths such as context.user.role are supported.
input.<key>
Values from the connector JSON payload. For non-JSON payloads, every input.* check is false.

Set context in middleware

middleware/assistant.py
async def before(content: dict, context: dict) -> dict:
    # Set context values that tool conditions can check.
    payload = context.get("payload", {})
    context["multiply_allowed"] = True
    context["admin"] = payload.get("role") == "admin"
    return content
Expression validation

Deployment rejects invalid Python expression syntax. At run time, unsupported expression forms and unknown roots evaluate to false. A bare accessor such as context.foo is a truthy check.

Discoverable tools

Loading a large tool set into the model context increases token usage and can reduce accuracy. Put infrequently used tools in discoverable_tools so the agent can find them on demand with a natural-language search. The list supports the same strings, wildcards, and conditions as tools. The search matches the words of the agent’s query against tool names and descriptions, so write descriptions in the language the agent works in. Finding a tool takes an extra model step before the call, so keep frequently used tools in tools.

agents/multi-purpose-assistant.yaml
version: "1.0"

name: multi-purpose-assistant
type: llm
model: connic/gpt-5.6-terra
description: "Assistant that discovers tools on demand to keep context lean"
system_prompt: |
  You are a multi-purpose assistant with access to many tools.

# Always available in the LLM context
tools:
  - math.calculator.add
  - math.calculator.multiply

# Indexed for on-demand discovery at runtime
discoverable_tools:
  - math.calculator.calculate_tax
  - orders.*
  - social.twitter.post_tweet
  - assistant_tools.*

Discoverable MCP servers

Mark an entire MCP server as discoverable to index its tools instead of loading them up front.

agents/agent.yaml
mcp_servers:
  - name: large-toolset
    url: https://mcp.example.com/tools
    discoverable: true   # tools indexed for search, not loaded upfront
No overlap allowed

A function cannot resolve from both tools and discoverable_tools. Deployment fails when the lists overlap.