Back to blog
Product·

Stateless connectors: a practical playbook for secure, auditable agent integrations

stateless connectors a practical playbook for secure auditable agent integrations

Agent integrations become hard to secure and explain when every request depends on hidden session state, broad credentials, and ad hoc execution paths. Stateless connectors provide a practical alternative: make each request independently verifiable, keep identity and authorization explicit, and send every consequential action through a consistent consent and audit path.

The goal is not to make an agent integration simpler by removing controls. It is to make it easier to scale, review, and operate by separating ephemeral request handling from durable security policy, records, and business data. The current MCP direction, alongside enterprise connector guidance from OpenAI and audit capabilities documented by Google Cloud, points to a useful operating principle: stateless by default, auditable by design.

What stateless connectors mean for agent integrations

Direct answer:

Stateless connectors

handle each agent request without relying on server-side session continuity. A secure implementation verifies the caller, authorization, request context, and integrity on every call; applies least-privilege action policy; and records the decision and outcome in an audit trail.

A connector is the integration boundary between an agent and an external capability. That capability may be an API, a business system, a data source, or a function that gathers information, analyzes data, or takes action. This boundary is where an organization can make the security-relevant questions explicit: who is calling, what can they do, why is the action allowed, what data will be involved, and what happened afterward.

Statelessness does not mean that the overall system has no state. A connector can still read and write durable business records, consult policy, retrieve secrets, create approval records, or emit audit events. It means the request-serving layer does not require an in-memory or server-affine protocol session to correctly process the next request.

That distinction matters in distributed environments. If a load balancer can send successive requests to different healthy instances without changing correctness, operations become less dependent on sticky routing and centralized session storage. In the MCP 2026-07-28 release candidate, the protocol core is stateless, and a remote MCP server can run behind a plain round-robin load balancer. The release candidate also describes routing by Mcp-Method and caching tools/list responses within the server’s TTL.

What changes in practice

  • No session store:

    the request path does not need a shared server-side session record merely to continue the protocol.

  • No sticky sessions:

    ordinary HTTP infrastructure and round-robin load balancing can distribute compatible requests across instances.

  • Explicit verification:

    identity, authorization, request scope, expiration, and integrity must travel in verifiable form or be resolved from authoritative systems on each call.

  • Clearer evidence:

    the system can associate every tool invocation with a principal, a policy decision, a consent state where applicable, and an outcome.

There is a useful boundary to keep in mind. Stateless transport does not eliminate the need to manage long-running work. MCP’s release candidate moves Tasks out of the core protocol and into an extension because production use showed that the capability needed redesign; task lifecycle is server-directed. For architects, that is a reminder not to smuggle workflow state back into a fragile request session. Long-running jobs need an explicit, durable, access-controlled lifecycle of their own.

Why stateless connectors improve scale and operational resilience

The immediate operational benefit is straightforward: requests can be handled by any suitable connector instance. That removes a common scaling constraint in session-oriented designs, where an application must either keep a user pinned to one instance or synchronize session information across instances before it can safely process the next message.

For MCP deployments using the 2026-07-28 protocol version, this is not only a conceptual option. The MCP C# SDK documentation states that HTTP POST requests are automatically routed through the stateless path. In that path, the server does not return an Mcp-Session-Id, and there is no GET/DELETE mapping. That is a concrete implementation signal: stateless connector behavior is being operationalized in SDKs as well as in the protocol direction.

Use ordinary infrastructure, but do not confuse it with security

A plain HTTP deployment model can reduce infrastructure complexity. You can place multiple connector instances behind a conventional load balancer, use health checks and horizontal scaling, and cache eligible discovery responses such as tools/list within the server-defined TTL. Those are real operational advantages for connectors that need to serve many agent requests reliably.

However, a round-robin architecture is not a security architecture. Statelessness transfers responsibility from implicit server affinity to explicit controls. Each instance must make the same authorization and policy decisions from trustworthy inputs. If one instance uses a different policy version, accepts a weaker token rule, or logs less detail, load balancing can turn inconsistency into a security and audit problem.

  1. Keep execution instances interchangeable.

    Package the connector so that any healthy instance can validate and handle an incoming request.

  2. Centralize authoritative policy, not request sessions.

    Policy may be evaluated locally from signed configuration or through a policy service, but its version and decision should be attributable.

  3. Cache only bounded, non-sensitive discovery data.

    Follow the connector server’s TTL for tool discovery responses rather than inventing indefinite caches.

  4. Test failover as a security scenario.

    Confirm that a request routed to another instance receives the same identity checks, action constraints, consent handling, and audit treatment.

Stateless architecture also improves incident handling when it makes behavior reproducible. An investigator should be able to reconstruct why a specific request was allowed without needing access to volatile memory on the instance that happened to receive it. That requires careful event design, which is a separate discipline from simply removing a session identifier.

Build the trust envelope for secure stateless connectors

A secure stateless connector should treat every request as an untrusted attempt to invoke a privileged capability. The connector can trust cryptographic verification, authoritative identity information, and narrowly defined server-side policy; it should not trust an agent-supplied narrative about who the user is, what they intended, or what it believes it may do.

The MCP TypeScript SDK migration guidance makes this point sharply for per-request state: treat it as untrusted input on re-entry. It recommends integrity protection using HMAC or AEAD, bound to the principal, method and parameters, and expiry. The binding is important. A value that is valid for one identity, method, payload, or time window should not silently become valid for another.

Minimum fields to verify on every action

  • Principal:

    identify the user, workload, or authorized service on whose behalf the action is requested.

  • Audience and connector:

    ensure credentials and assertions are intended for this connector and environment, rather than merely being valid somewhere.

  • Requested method and parameters:

    determine the exact tool operation and validate its schema, allowed values, and policy-relevant fields.

  • Permission and purpose:

    evaluate whether this principal may perform this action for the permitted business purpose.

  • Time bounds:

    reject expired or otherwise invalid authorization material, and bind transient state to a defined expiry.

  • Integrity:

    use HMAC or AEAD where per-request state must return to the connector, binding it to principal, method or parameters, and expiry as the SDK guidance describes.

  • Consent or approval state:

    for actions that require user confirmation or an organizational approval, verify that the approval applies to this exact action scope.

Authorization design should be conservative. The MCP roadmap identifies security and authorization hardening as a major recent focus, including issuer validation, issuer-bound client credentials, Client ID Metadata Documents as preferred client registration paths, and stable Enterprise-Managed Authorization. The practical lesson is to avoid treating token possession alone as the full trust decision. Validate the issuer and client context, establish what credential is bound to, and use managed authorization patterns where they fit the organization.

The MCP registry’s documented ecosystem also includes infrastructure concepts such as OIDCTokenExchangeInputBody, SignatureTokenExchangeInput, and Transport. Even when a team does not use every mechanism, these references reinforce a healthy design approach: authentication, token exchange, signatures, and transport are integration concerns to model deliberately, not details to bolt on after tools are published.

Apply least privilege and action constraints before tools reach production

For agents, the dangerous question is rarely whether a connector can authenticate. It is whether the agent can use a legitimate connection to do too much. A read-only knowledge lookup, a customer-record update, and a payment-related action may all be exposed through “a connector,” but they have very different impact and need different constraints.

OpenAI’s Workspace Agents guidance recommends least privilege, limiting the audience, avoiding sensitive or high-impact connectors, and regularly auditing agent configurations. It also documents connector action constraints as a control configured by agent builders for supported apps and connectors. Treat these constraints as part of the connector’s security contract, not as optional interface settings.

Define the action surface deliberately

Start with the smallest collection of tools that can support a real workflow. Resist publishing a general-purpose administrative API simply because the underlying system has one. A narrow connector is easier to test, easier to authorize, and easier for users and reviewers to understand.

  • Separate search and retrieval tools from mutation tools.

  • Expose a focused operation such as “create a draft” instead of a broad “manage records” capability where the workflow permits it.

  • Limit which users, groups, or agents can discover and invoke a connector.

  • Constrain supported action types and relevant parameter ranges for each agent.

  • Keep sensitive and high-impact connectors out of scope unless there is a clear business need and a defensible review process.

  • Reassess tool definitions and agent configurations regularly as business processes and connector capabilities change.

Least privilege applies to data as well as actions. A connector that retrieves a large, unrestricted dataset may let an agent infer or expose information beyond what the immediate task requires. Design tools around specific data needs and apply identity-based, purpose-limited, and time-bound permissions. A recent OpenAI privacy paper argues that cloud-by-default agents can create opaque data flows and weak auditability, and calls for trusted, auditable control layers with precisely those properties.

There is a trade-off: highly granular tools and permissions create more design and maintenance work. Yet broad tools create a much larger blast radius and make meaningful review harder. For most enterprise agent integrations, starting narrowly and expanding from observed, reviewed use cases is the more defensible path.

Design an audit trail that explains every connector decision

Auditability is not satisfied by recording that an HTTP request occurred. A useful audit trail lets a reviewer understand the actor, requested operation, target or scope, governing policy, authorization or consent result, execution outcome, and correlation to related workflow events. It should support both routine review and incident reconstruction without storing more sensitive content than is necessary.

Google Cloud’s Integration Connectors documentation provides a concrete model: each method call generates an audit log, and the category is determined by the permission type required for the method. The page is marked last updated 2026-08-26 UTC. This illustrates an important principle for connector design: logging should be coupled to the method and permission model, not left to scattered application code that may miss unusual execution paths.

Capture the evidence that matters

  1. Record the principal and client context.

    Identify the authenticated user or workload and the authorized client or agent configuration involved.

  2. Record the requested tool and action scope.

    Include the normalized tool name, relevant target identifiers, and a safe representation of policy-relevant parameters.

  3. Record the decision.

    Preserve whether the action was allowed, denied, constrained, escalated for consent, or blocked by validation.

  4. Record the reason and policy version.

    A decision is more useful when reviewers can identify the rule or version that produced it.

  5. Record the outcome.

    Distinguish an authorized request that failed operationally from one that succeeded, and correlate retries without obscuring the original decision.

  6. Protect the audit data.

    Audit records can themselves be sensitive. Restrict access, preserve integrity, and avoid placing unnecessary secrets or raw sensitive content in logs.

Consistency across paths is essential. The MCP release candidate says that UI-initiated actions follow the same audit and consent path as direct tool calls. That avoids a common control gap in which a rich interface bypasses enforcement designed for API-style invocations. If an action can be initiated through chat, a tool call, or a connector-provided UI, the security decision and evidence model should remain coherent.

Audit trails also improve operational quality. They reveal unused high-risk tools, unexpected denial patterns, tools invoked with unusual scopes, and agents that repeatedly require escalation. Regular connector audits should examine configuration as well as events: who can use each connector, which actions are enabled, whether the intended audience remains correct, and whether sensitive integrations are still justified.

Defend stateless connectors against prompt injection and untrusted outputs

Statelessness removes session affinity; it does not make an agent resistant to malicious instructions. Prompt injection remains a major security consideration for connector-enabled agents, particularly when tools can access sensitive information or take action. An untrusted document, ticket, web page, or tool result can attempt to redirect an agent away from the user’s legitimate task and toward a harmful connector operation.

The right response is not to assume the model will always recognize hostile content. Build connector controls that remain effective even if untrusted text influences the agent’s reasoning. The connector should enforce permissions and action constraints independently of model intent, and high-impact actions should have explicit approval or consent mechanisms appropriate to the workflow.

Keep content, instructions, and authority separate

  • Label retrieved or tool-returned material as untrusted data rather than treating it as an authority to change connector policy.

  • Do not allow arbitrary text from external systems to expand tool permissions, switch identities, or override action constraints.

  • Require the connector to validate operation schemas and server-side policy regardless of how the agent formed its request.

  • Use confirmation and consent for consequential operations, with the requested action and scope made understandable to the person approving it.

  • Limit the connector’s accessible data and permitted actions so that a successful injection has a smaller blast radius.

URLs deserve separate treatment. OpenAI’s MCP guidance cautions that requesting URLs or embedding image URLs returned by connector or remote MCP tool outputs can be dangerous. Do not treat a URL in a tool result as a trusted destination merely because it came through an authenticated connector. Apply a deliberate handling policy before fetching, displaying, embedding, or passing such URLs to another system.

Private connectivity reduces a different but related exposure. OpenAI documents Secure MCP Tunnel as a way to connect a private or on-premises MCP server without exposing it to the public internet. This can be valuable for internal integrations, but it is not a substitute for authorization, action constraints, or audit logging. A private endpoint can still be misused by an over-privileged agent or through prompt injection if the connector’s own controls are weak.

Use MCP Apps and extensions without creating alternate control paths

Agent integrations increasingly include interactive experiences, not just opaque API calls. The MCP release candidate notes that tools can declare UI templates a of time, allowing hosts to prefetch, cache, and security-review them before anything runs. This is a meaningful control point: teams can inspect the declared interface before users encounter it and before execution begins.

Use this capability to establish a review workflow for connector-provided UI. Review what the template presents, what actions it can initiate, how it explains sensitive operations, and whether its interaction model matches the tool permissions granted to the agent. Cache behavior should follow the applicable rules, while security review should be triggered by relevant changes rather than assumed to be permanently complete.

Keep extensions explicit and contained

The release candidate frames its stateless core alongside an extensions framework, Tasks, MCP Apps, authorization hardening, and a formal deprecation policy. That combination supports long-lived evolution, but only if adopters avoid treating every extension as implicitly safe. Extensions alter the integration surface and may change lifecycle, data handling, or authorization requirements.

Tasks are an especially useful example. Because the capability now lives as an extension and its lifecycle is server-directed, teams should define who may start a task, what durable state it creates, who may inspect or cancel it, how results are linked to the initiating identity, and how task events are audited. Do not rely on a vanished transport session to answer those questions.

Formal deprecation also deserves operational attention. Connector owners should maintain an inventory of protocol versions, SDK versions, extensions, tools, and client dependencies. When a protocol evolves, test both security controls and functional behavior. A migration that preserves successful tool calls but weakens issuer validation, request integrity, or logging is not a successful migration.

A practical rollout playbook for stateless, auditable integrations

Adopting stateless connectors is best handled as a controlled redesign of the integration boundary, not a transport-only migration. Begin with one bounded workflow that has a clear owner, limited user audience, understandable data access, and a manageable action surface. Use what you learn to set reusable standards before expanding to more sensitive systems.

  1. Inventory the current connector path.

    Document each tool, caller type, data source, action type, credential, approval step, and logging destination. Identify where a server-side session is carrying security-relevant context that should become explicit.

  2. Classify tools by impact.

    Separate retrieval, analysis, draft creation, external communication, record mutation, and other consequential actions. Decide which classes can be enabled at all for the intended audience.

  3. Make request context verifiable.

    Validate identity and authorization on every call. Where per-request state must round-trip, protect it with HMAC or AEAD bound to principal, method or parameters, and expiry.

  4. Deploy interchangeable connector instances.

    Use ordinary HTTP infrastructure where appropriate, avoid sticky sessions, and verify that any instance can make the same policy decision and produce the same audit evidence.

  5. Implement action constraints and consent.

    Configure available connector action constraints, limit audience, and make high-impact actions require the right approval path.

  6. Unify direct and UI-initiated execution.

    Ensure tool calls and actions initiated from declared UI templates traverse the same authorization, consent, and audit controls.

  7. Test hostile inputs and failure modes.

    Include prompt-injection scenarios, malformed or replayed request context, suspicious URLs in tool outputs, expired permissions, denied actions, instance failover, and long-running task behavior.

  8. Review continuously.

    Audit agent configurations, connector permissions, action constraints, tool inventory, and event records on a regular basis. Remove capabilities that lack a current owner or justified use case.

A successful rollout produces more than a working connector. It produces an explainable system: an authorized reviewer can see why an agent had access, what it was allowed to attempt, how a specific request was evaluated, whether consent was obtained, and what outcome followed. That is the standard worth applying before an integration gains broader reach.

Stateless connectors are most valuable when they are paired with explicit trust boundaries rather than treated as a scaling optimization alone. Use stateless request handling to simplify deployment, then use issuer-aware authorization, least-privilege tools, action constraints, protected request context, unified consent, and method-level audit evidence to make agent integrations secure and auditable as they evolve.