langflow-ai/langflow · error · HTTPException

A2A access is disabled for this agent: unsupported folder au

Error message

A2A access is disabled for this agent: unsupported folder auth type {auth_type!r}.

What it means

Raised by _enforce_a2a_auth when the flow lives in a folder whose auth_type is neither 'none', 'apikey', nor 'oauth' — e.g. a future/unknown scheme. A2A can only enforce owner-scoped API-key auth, so a protected folder with a scheme it cannot enforce fails closed with 403 instead of silently running the flow publicly. The flow always executes as its owner, so relaxing the gate would mean unauthenticated execution under the owner's identity.

Source

Thrown at src/backend/base/langflow/api/v1/a2a.py:126

      happens in front); the langflow transport itself still takes an owner-scoped api key,
      exactly as the MCP transport does (``mcp_projects.verify_project_auth``), since credential
      forwarding from the broker isn't available yet. Accepting another user's valid key would
      let them trigger a run under the owner's identity, so scope to ``flow.user_id``.
    - anything else (an auth type A2A doesn't understand) -> fail closed with 403: treating a
      *protected* folder as public would expose an owner-identity run anonymously.

    Uses ``check_key`` directly, NOT ``api_key_security``: under AUTO_LOGIN the latter
    returns the superuser for a *missing* key, which would silently bypass this gate.
    """
    # Short writable session (check_key flushes usage counters), closed before
    # dispatch so no lock is held across the up-to-300s run.
    async with session_scope() as session:
        auth_type = await folder_auth_type(flow, session)
        if auth_type == "none":
            return  # public agent
        if auth_type not in ("apikey", "oauth"):
            # Protected folder with a scheme A2A can't enforce: fail closed, never public.
            raise HTTPException(
                status_code=status.HTTP_403_FORBIDDEN,
                detail=f"A2A access is disabled for this agent: unsupported folder auth type {auth_type!r}.",
            )
        api_key = request.headers.get(A2A_APIKEY_HEADER)
        if not api_key:
            raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="API key required")
        user = await check_key(session, api_key)
        # Same message for invalid and wrong-owner: don't reveal a key is valid for another user.
        if user is None or user.id != flow.user_id:
            raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid API key")


class _FlowContextBuilder(DefaultServerCallContextBuilder):
    """Carry the per-request flow_id into the shared executor via call-context state."""

    def build(self, request: Request) -> ServerCallContext:
        context = super().build(request)
        # Canonicalize to the same string form the resume guard uses (str(UUID(...))), so the durable

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Set the folder's auth_type to a supported value: 'none' (public agent), 'apikey', or 'oauth' (fronted by an external OAuth broker)
  2. If you truly need the custom scheme, front the A2A endpoint with a proxy that enforces it and set the folder to 'none' with appropriate network controls
  3. Report/patch the component that wrote the unsupported auth_type value

Example fix

-- before: folder row auth_type='saml'
-- after: UPDATE folder SET auth_type='apikey' WHERE id='<folder-id>';
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_FOLDER_AUTH = {"none", "apikey", "oauth"}

def folder_auth_supported(auth_type: str | None) -> bool:
    return (auth_type or "none") in SUPPORTED_FOLDER_AUTH

Try / catch

try:
    await client.send_message(flow_id, msg)
except A2AClientError as e:
    if "unsupported folder auth type" in str(e):
        raise ConfigError(f"Folder auth {extract_auth_type(str(e))!r} unsupported by A2A; switch to none/apikey/oauth") from e
    raise

Prevention

When it happens

Trigger: POST /api/v1/a2a/{flow_id}/jsonrpc for a flow whose folder has an auth_type value outside the supported set (custom/legacy auth scheme stored in the folder record).

Common situations: A plugin or manual DB edit introduced a new folder auth_type; upgrading Langflow where folder auth schemes changed; copying folder rows between environments with schema drift.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/f43ac51c1a271d98. Report an issue: GitHub.