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 200 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.
accessobjectOptionalWhat the database, file, and Retrieval tools may read and change, in the same format as apps. Once set, anything without a rule is denied. Omit for unrestricted access. See Access rules.
databasemapOptionalRules per collection, and "*" for every other collection: read, insert, update, delete, set, and fields.
filesmapOptionalRules per folder, and "*" for the whole tree: read, write, update, delete, and set. They also cover files that retrieval_store imports, retrieval_query share links, and browser downloads and uploads.
retrievalmapOptionalRules per namespace, and "*" for every other namespace: search, store, and delete.
lookupsmapOptionalDocuments, or lists of values, that access rules use by name. Needs access. See Lookups.
databaseobjectOptionalDeprecated. Older database tool limits with collections, prevent_delete, and prevent_write. connic still enforces them; connic lint prints the access block to use instead. See Replace database, retrieval, and files.
retrievalobjectOptionalDeprecated. Older Retrieval tool limits with namespaces, prevent_delete, and prevent_write. Replace them with access.
filesobjectOptionalDeprecated. Older file tool limits with folders, prevent_delete, prevent_write, and session_only. Replace them with access.
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
browserobjectOptionalBrowser tool settings. See Passkeys.
passkeysstring[]OptionalNames of passkeys from Settings → OAuth & Passkeys that the agent’s browser signs in with. Maximum 10. A deployment fails when a name is not configured in its environment.Default: []
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 200-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
filesbooleanOptionalInclude files from earlier runs in the reused history. False replaces each one with a short note, so the model does not receive it again.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. Voice agents take only enabled and max_prompt_tokens; see connic voice.
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 as a code such as en or de-DE. connic adds it to the model instructions, which set the language the agent speaks, and passes it to the provider's transcription of the other side's speech. Recognition still follows the language spoken.
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, Vertex AI, and connic/gemini-3.8-live 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
press_keys_allowedbooleanOptionalGive the agent the press_keys tool to press phone keys, such as in a phone menu.Default: true
wait_on_hold_allowedbooleanOptionalGive the agent the wait_on_hold tool to wait in a queue or on hold until a person answers.Default: false
max_hold_secondsintegerOptionalEnd the call once the agent has waited on hold this long, from 1 to 3600 seconds. Requires wait_on_hold_allowed.
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.Default: 500
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.
min_speech_msintegerOptionalHow long the user must keep speaking while the agent talks before the agent stops, from 0 to 5000 milliseconds.Default: 500
idle_timeout_secondsintegerOptionalEnd the call after this many seconds without speech. Only speech counts: the agent's speech and the other side's transcribed speech. Running tools, provider-reported background work, and waiting on hold keep the call open. 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.

An agent can expose at most 200 tools. Each function a tools entry resolves to counts once: billing.* counts every sync or async function defined in tools/billing.py whose name does not start with _, but not functions imported into that file. A predefined or API spec wildcard counts every tool it matches, so web_browser_* counts 15. Generated approval.inputs tools count, and making any tool discoverable adds two tools the agent uses to find and call it. Discoverable tools, MCP server tools, and agent-tool outbound connectors do not count. connic lint reports an agent over the limit.

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. A tool whose condition is false for a run doesn't show up in the search and can't be called. Tool hooks and approval.tools treat a discovered tool like one listed under 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.