Conversational and Execution Agents: Protocol-Based Collaboration in Practice

    Connecting conversational and execution agents requires more than passing messages between them. This article explains how task contracts, reusable schemas, verifiable authorization, semantic descriptions, and structured state events support reliable collaboration. It outlines a five-layer architecture and practical approaches to phased deployment, contract testing, observability, cost management, and security.

    1. Collaboration Is More Than Putting Two Agents in the Same Conversation

    Many teams start with a reasonable idea: one agent excels at conversation, clarifying requirements, and explaining results, while another excels at tool use, long-running tasks, and automated workflows. Why not simply let the first call the second?

    That approach often works quickly in a demo. In production, however, it tends to expose problems with state, permissions, cost, and failure recovery.

    The real objective is not to “connect” two agents, but to enable heterogeneous agents to collaborate through explicit contracts. The conversational agent interprets intent, fills in missing constraints, proposes plans, and explains results. The execution agent validates plans, invokes tools, advances tasks, and handles retries and compensating actions. Their interface should carry structured tasks, state events, and verifiable results—not just natural language.

    Without an intermediate contract, direct integration creates four common risks:

    1. Conversation context becomes the interface. Conversation history may contain guesses, assumptions, outdated information, or malicious prompt injections. An execution agent that reads the entire conversation can easily confuse “the user mentioned this earlier” with “the user authorized this task.”
    2. State cannot be synchronized reliably. Execution agents often run asynchronously. Tasks may be queued, time out, succeed partially, or wait for human approval. Without task identifiers and a state machine, the conversational agent may repeatedly poll or resubmit work, causing duplicate orders, deletions, or notifications.
    3. Permissions expand unintentionally. Permissions granted to a conversational agent should not automatically pass through to an execution agent. The executor needs to know who initiated the task, who issued the authorization, what actions are allowed, how long the authorization lasts, and whether it can be revoked—not merely receive a broad token.
    4. Failures cannot be reconstructed. A final answer and a few messages are insufficient to determine whether a failure occurred during intent interpretation, plan compilation, authorization checks, tool execution, or result explanation.

    The design target is therefore a minimal collaboration protocol: how tasks are expressed, schemas are reused, identity is conveyed, semantics are described, state is reported, and failures are audited.

    2. Four Foundational Problems the Protocol Must Address

    2.1 Schema Reuse: Avoid Repeating Field Names in Every Record

    Field-heavy APIs often repeat the same field names in every record and every page: ID, name, price, description, category, inventory, and so on.

    The model may already understand the schema after the first response, but conventional web interfaces have no protocol-level concept of “you already know this.” The bytes are still transmitted, the tokenizer still processes them, and the cost is still incurred. Repetition becomes more noticeable as field density and pagination increase. Its actual share of the workload depends on the application and should be measured.

    A practical design separates schema definitions from record data:

    • Maintain a schema registry with versions and hashes. The first exchange can inline the full schema; later responses can use a reference.
    • Include a schema reference, version, and compatibility indicator so the receiver can decode the response.
    • Provide a fallback for unknown or outdated schemas, allowing the server to send the full definition again.
    • Apply compatibility rules to schema changes, managing optional field additions separately from breaking changes.
    • Do not assume the model will always remember a schema. Include explicit references and use a local decoder or validator to assist processing.

    An illustrative frame looks like this:

    1. Frame {
    2. task_id: "..."
    3. schema_ref: "product.v3#hash-..."
    4. semantics_version: "2026-01"
    5. records: [
    6. ["P-1001", "Sample Product", 199, "Category A", 12],
    7. ["P-1002", "Sample Product Two", 299, "Category B", 8]
    8. ]
    9. }

    The benefit is not limited to token savings. Explicit schema references also provide a basis for schema evolution, caching, validation, and replay. Abbreviating field names alone may help in the short term, but can undermine both readability and compatibility over time.

    2.2 Agent Identity: Do Not Forward User Tokens Unchanged

    When an agent calls a service on a user’s behalf, the service needs protocol-level answers to several questions:

    • Who issued the agent’s credentials?
    • Which principal does it represent?
    • What is its permission scope?
    • Has the user authorized the operation?
    • Has the authorization been revoked?
    • Does this task permit high-risk actions?

    Placing a generic token in a request header and expecting each gateway to interpret it independently leads to duplicated effort and inconsistent implementations.

    A more robust approach uses a verifiable invocation context:

    1. Invocation {
    2. principal: "user-123"
    3. agent: "executor-agent"
    4. issuer: "trusted-issuer"
    5. task_id: "task-789"
    6. scope: ["order:read", "order:refund:limit"]
    7. parent_task: "task-456"
    8. expires_at: "short-lived"
    9. signature: "..."
    10. }

    The key principles are least privilege, short-lived validity, task binding, traceable delegation chains, revocability, and auditability.

    The conversational agent should narrow the user’s authorization before delegating it, rather than copying the full permission set. The executor must still perform a policy check before invoking a specific tool.

    Operations with side effects—such as refunds, deletions, publishing, and transfers—should also require an independent approval credential or a human confirmation event. A prompt that says “please confirm” is not an authorization mechanism.

    2.3 Semantic Descriptions: Move Field Meaning Out of Prompts

    APIs often return structured data while leaving callers to infer its meaning. Is a timestamp measured in seconds or milliseconds? What does status code 2 mean? Does an amount include tax? Does inventory include reserved stock? Is an error retryable?

    These details are often placed in system prompts, forcing the model to reinterpret them during each reasoning cycle. That consumes context and introduces inconsistency.

    A better approach is to maintain machine-readable semantic descriptions of capabilities, including field types, units, enum mappings, constraints, error meanings, side-effect levels, idempotency, and approval requirements.

    For example:

    1. {
    2. "field": "status",
    3. "type": "enum",
    4. "mapping": {"1": "Pending", "2": "Shipped", "3": "Canceled"},
    5. "semantics": "Order shipping status",
    6. "invariant": "A canceled order cannot subsequently be shipped"
    7. }

    Service owners should maintain and version these descriptions. They should not be generated arbitrarily by a model at runtime and then trusted without validation.

    This semantic layer reduces repeated reasoning, enables deterministic validation, gives error handling a consistent interpretation, and helps different agents understand the same field in the same way. It is not a replacement for documentation; it is a contract that software can consume.

    2.4 State and Orchestration: Clarify in Natural Language, Execute Through Structured Events

    The most dangerous interface between conversational and execution agents is an unstructured natural-language instruction.

    Natural language is useful for clarification and explanation, but it should not be the sole source of truth for execution. The execution path should revolve around a task contract:

    1. TaskContract {
    2. goal: "Complete a low-risk query and summarize the results"
    3. inputs: {...}
    4. success_criteria: [...]
    5. constraints: ["Read-only", "Do not access sensitive fields"]
    6. allowed_tools: ["query_catalog"]
    7. idempotency_key: "..."
    8. approval: "not_required"
    9. }

    Task states should be modeled explicitly: created, planned, awaiting user input, running, partially successful, succeeded, failed, compensated, and canceled.

    Every state transition should include a task ID, parent task ID, timestamp, reason code, and auditable event. When returning results, the execution agent should prioritize structured events and summaries. The conversational agent can then turn them into a user-facing explanation.

    This approach supports long-running tasks and makes it possible to locate failures at a specific stage.

    A collaboration system can be divided into five layers:

    1. Interaction layer: The conversational agent handles intent interpretation, clarification, draft plans, result explanation, and user confirmation.
    2. Orchestration layer: Compiles plans into task contracts, checks policies, classifies risk, routes approvals, and advances the state machine.
    3. Protocol layer: Defines message frames, schema references, semantic versions, identity contexts, error codes, and idempotency keys.
    4. Execution layer: The execution agent invokes tools or services and handles timeouts, retries, compensating actions, and partial failures.
    5. Governance layer: Provides shared identity, authorization, auditing, quotas, sensitive-data redaction, replay, and cost accounting.

    A typical flow looks like this:

    1. intent = dialogue.clarify(user_input)
    2. plan = dialogue.propose_plan(intent)
    3. contract = policy.compile(plan, user_scope, risk_policy)
    4. if not validator.validate(contract):
    5. return dialogue.ask_for_clarification(contract.errors)
    6. if contract.requires_approval:
    7. approval = approval_gate.request(contract)
    8. contract = contract.with_approval(approval)
    9. result = executor.run(contract)
    10. events = result.events
    11. return dialogue.explain(events)

    The important part is not the code syntax, but the boundaries:

    • The conversational agent does not directly execute high-risk actions.
    • The execution agent does not independently guess user intent.
    • The orchestration layer does not trust unvalidated natural language.
    • The governance layer does not rely on after-the-fact logs to compensate for missing authorization controls.

    4. Key Engineering Practices

    4.1 Start with a Minimal Protocol Surface

    Avoid designing a large protocol framework at the outset.

    A minimal end-to-end implementation can include only:

    • Task ID and parent task ID
    • Schema reference
    • Semantic version
    • Identity context
    • Permission scope
    • Idempotency key
    • State events
    • Error codes
    • Audit trace ID

    Once these fields are stable, adding streaming events, batch results, approval steps, and multilevel delegation becomes easier.

    4.2 Roll Out Progressively

    Use a phased deployment strategy:

    Phase 1: Read-only, low-risk, replayable tasks. Start with catalog queries, knowledge retrieval, or status summaries. Focus on validating schema reuse and result explanation.

    Phase 2: Low-risk write operations. Validate idempotency, retries, and permission narrowing.

    Phase 3: High-risk operations. Introduce approval workflows, two-person review, or human confirmation.

    Each phase should have clear exit criteria. Expand only after metrics such as success rate, duplicate execution rate, unauthorized-action blocking rate, human intervention rate, and average task cost meet the intended targets.

    4.3 Build Observability and Replay Capabilities

    Logs must contain more than conversation text and final answers.

    At a minimum, record:

    • Trace ID and task ID
    • Schema and semantic versions
    • Policy decisions
    • Summaries of tool-call parameters and results
    • State transitions
    • Retry reasons
    • Approval records
    • Redaction markers

    Sensitive fields should be redacted or stored separately and referenced. Do not place private data directly into model context merely to support replay.

    Failed cases should be replayable in an isolated environment so that fixes can be verified.

    4.4 Make Contract Testing Routine

    Testing should cover more than whether the happy path completes. Important cases include:

    • Whether added schema fields remain backward-compatible
    • Whether unknown schema references trigger a fallback
    • Whether idempotency keys prevent duplicate callback processing
    • Whether expired or revoked tokens are rejected immediately
    • Whether tool timeouts produce the correct partial-success outcome
    • Whether the state machine remains stable when execution events arrive out of order

    Contract tests should exercise the boundary between conversational and execution agents, not just each agent’s internal logic.

    4.5 Manage Cost at the Task Level

    Schema reuse is a cost-reduction technique, but response size alone is not an adequate metric.

    More useful measures include:

    • Token cost per successful task
    • Tool calls per successful task
    • Additional cost associated with human intervention

    Token optimization must not remove information required for auditing. Semantic versions, authorization decisions, and error reasons should be retained.

    Context summaries support reasoning; original events support auditing. These are different purposes and should not be conflated.

    4.6 Put Security Controls Before Execution

    Security controls should operate across the workflow:

    • Input: Detect prompt injection, attempts to induce unauthorized actions, and malicious tool parameters.
    • Output: Validate structured results and check for sensitive information.
    • Execution: Restrict the available tool set, parameter ranges, and call frequency.
    • Approval: Require human confirmation or an independent policy decision for high-risk actions.

    A model’s statement that “confirmation has already been obtained” cannot replace a real authorization event.

    5. Common Pitfalls

    Treating a Shared Conversation Loop as Collaboration

    Putting two agents into the same conversation does not establish reliable coordination. Free-form exchanges can increase uncertainty and cost. Effective collaboration depends on task contracts and state events.

    Using Natural Language as the Only Interface

    Natural language is appropriate for clarification, but not as the sole carrier of authorization, idempotency, retry, and audit semantics.

    Optimizing Prompts but Ignoring the Protocol

    Prompts can improve communication, but they cannot replace schema reuse, identity verification, or state machines.

    Testing Only Successful Execution

    Many production failures arise from timeouts, duplicate callbacks, partial success, token revocation, and incompatible schemas.

    Confusing Identity Propagation with Authorization

    Identity answers “who is calling?” Authorization must also specify what that caller may do, for which task, within what limits, and until when.

    Pursuing Full Automation from the Start

    High-risk workflows should retain approval steps and human fallback. The level of automation should match the level of risk.

    6. Conclusion

    Combining conversational and execution agents is a sound engineering direction: one provides clarification and explanation, while the other provides execution and task completion. But direct integration is a prototype approach; protocol-based collaboration provides the foundation for production.

    Start with a minimal end-to-end workflow built around task contracts, schema references, identity and authorization, semantic descriptions, and state events. Then progressively add approvals, replay, quotas, and multilevel delegation.

    The value is not merely getting two agents to work together. It is making each collaboration verifiable, controllable, auditable, and able to evolve.