{"record":{"id":"27485caa7d12dfda","repo":"langchain-ai/deepagents","slug":"config-provider-self-exposure-requires-operator","errorCode":null,"errorMessage":"{config.provider} self exposure requires {operator_var}; set {exposure_var}=allowlist or open for other modes","messagePattern":"(.+?) self exposure requires (.+?); set (.+?)=allowlist or open for other modes","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/channels/base.py","lineNumber":204,"sourceCode":"        Parsed exposure policy.\n\n    Raises:\n        ValueError: If the exposure mode is invalid or risk acknowledgement is missing.\n    \"\"\"\n    prefix = config.env_prefix\n    exposure_var = f\"{prefix}_EXPOSURE\"\n    operator_var = f\"{prefix}_OPERATOR_ID\"\n    mode = _exposure_mode(\n        env.get(exposure_var, ExposureMode.SELF.value),\n        provider=config.provider,\n    )\n    operator_ids = frozenset(split_csv(env.get(operator_var, \"\")))\n    if mode == ExposureMode.SELF and config.require_self_operator and not operator_ids:\n        msg = (\n            f\"{config.provider} self exposure requires {operator_var}; \"\n            f\"set {exposure_var}=allowlist or open for other modes\"\n        )\n        raise ValueError(msg)\n    if mode == ExposureMode.OPEN:\n        _require_open_acknowledgement(env, config)\n        logger.warning(\n            \"%s open exposure enabled; arbitrary senders can trigger the agent with \"\n            \"operator credentials and local host access\",\n            config.provider,\n        )\n    return ChannelExposure(\n        mode=mode,\n        conversations=frozenset(split_csv(env.get(f\"{prefix}_ALLOWLIST_CHATS\", \"\"))),\n        mention_patterns=tuple(split_csv(env.get(f\"{prefix}_MENTION_PATTERNS\", \"\"))),\n        operator_ids=operator_ids,\n    )\n\n\ndef outbound_media_root_from_env(env: Mapping[str, str]) -> Path:\n    \"\"\"Return the trusted outbound media root for channel attachments.\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/channels/base.py#L186-L222","documentation":"Talon channels are built from environment variables; when a provider channel uses `self` exposure mode (only the operator's own messages trigger the agent), at least one operator id must be configured. `channel_exposure_from_env` raises this ValueError when `require_self_operator` is set for the provider and the `<PREFIX>_OPERATOR_ID` env var is empty while mode is `self`. It also hints that other senders can be allowed by switching the exposure var to `allowlist` or `open`.","triggerScenarios":"Calling `channel_exposure_from_env(env, config)` (via `from_talon_config`) where the resolved exposure mode is `ExposureMode.SELF` (the default), `config.require_self_operator` is True, and `env[f'{prefix}_OPERATOR_ID']` is unset or an empty/CSV-blank string.","commonSituations":"Deploying a Telegram/WhatsApp channel with `DEEPAGENTS_TALON_TELEGRAM_EXPOSURE=self` (or no exposure var at all, since self is default) but forgetting to set `DEEPAGENTS_TALON_TELEGRAM_OPERATOR_ID`; renaming prefixes between versions; typos in the operator id env var name.","solutions":["Set the operator env var, e.g. `DEEPAGENTS_TALON_TELEGRAM_OPERATOR_ID=<your-chat-or-user-id>`.","If you want other senders, set `<PREFIX>_EXPOSURE=allowlist` and configure allowed conversations, or `open` with the risk acknowledgement var.","Verify the env prefix matches the provider's `ChannelExposureEnv.env_prefix` so the correct var name is read."],"exampleFix":"# before\nDEEPAGENTS_TALON_TELEGRAM_EXPOSURE=self\n# (no operator id set)\n\n# after\nDEEPAGENTS_TALON_TELEGRAM_EXPOSURE=self\nDEEPAGENTS_TALON_TELEGRAM_OPERATOR_ID=123456789","handlingStrategy":"validation","validationCode":"import os\nprefix = 'DEEPAGENTS_TALON_TELEGRAM'\nmode = os.environ.get(f'{prefix}_EXPOSURE', 'self')\nif mode == 'self' and not os.environ.get(f'{prefix}_OPERATOR_ID', '').strip():\n    raise SystemExit(f'{prefix}_OPERATOR_ID is required when {prefix}_EXPOSURE=self')","typeGuard":null,"tryCatchPattern":"try:\n    exposure = channel_exposure_from_env(env, config)\nexcept ValueError as exc:\n    logging.error('bad channel exposure config: %s', exc)\n    raise SystemExit(2) from exc","preventionTips":["Always set the operator id env var alongside self exposure in deploy templates.","Default to allowlist with explicit conversation ids when operator ids are unknown.","Fail fast at startup rather than in the message loop."],"tags":["config","env","validation"],"backgroundTag":"missing-env-var","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}