Learning resourcesReviewed · E2B

OpenClaw Telegram guide for E2B sandboxes

This is an E2B documentation guide for developers who want to run the OpenClaw AI agent in an E2B cloud sandbox and chat with it through a Telegram bot. The example enables allowInsecureAuth and dangerouslyDisableDeviceAuth for the gateway control UI while retaining gateway token authentication; the page does not explain the security consequences or state service costs. It gives TypeScript and Python code to create the sandbox, enable the Telegram plugin, add the bot token, start the gateway in the background and approve a Telegram user with a pairing code.

Researched 15 Nov 2026

In short.

This is an E2B documentation page for developers who want to run the OpenClaw AI agent inside an E2B cloud sandbox and talk to it through a Telegram bot. The example enables allowInsecureAuth and dangerouslyDisableDeviceAuth for the gateway control UI while retaining gateway token authentication; the page does not explain the security consequences or state service costs. Technically, the page shows how to create an E2B sandbox from a template named openclaw, pass OPENAI_API_KEY and TELEGRAM_BOT_TOKEN as environment variables, set the primary model to openai/gpt-5.2, enable the Telegram plugin, register the bot with openclaw channels add, start openclaw gateway in the background on port 18789 and approve the first Telegram user with a pairing code. It also lists commands to check channel status and read logs, and four troubleshooting entries. It was assessed only from the page text. Nothing was run, so the steps are unverified here.

Researched and written by an AI model and checked by a second AI model. How it works

This report covers only the single documentation page at [https://docs.e2b.dev/agents/openclaw/openclaw-telegram.md], captured in full on 2026-11-15 (6,614 bytes). Pages it links to are excluded: the related OpenClaw gateway page, @BotFather and the docs index at [https://docs.e2b.dev/llms.txt]. No OpenClaw, E2B, OpenAI or Telegram documentation beyond this page was consulted. Nothing was executed. The commands, flags, model name, template name and troubleshooting advice are reported as the page states them and were not verified. Licence terms, prices, tested versions and the effect of the insecure gateway settings are not given on the page and are reported as unknown.

The overview

What this resource is

This is a single documentation page titled OpenClaw Telegram, hosted on the E2B docs site at [https://docs.e2b.dev/agents/openclaw/openclaw-telegram.md]. It is a how-to guide, not software you install. Its stated purpose is to connect OpenClaw to Telegram in an E2B sandbox, approve user pairing and chat through your bot.

OpenClaw is the AI agent being deployed. E2B is the sandbox service that hosts it. The page describes OpenClaw as supporting Telegram as a chat channel. It does not explain what OpenClaw is beyond that, and it names no author, version or release date.

Overall assessment

On the page text alone, this is a concrete, ordered walkthrough with working-looking code in two languages, a pairing step, verification commands and troubleshooting. It is more than a stub. The page says it covers the working flow the authors used, but it gives no date, version numbers or test log, so how current or reproducible it is remains unknown.

The main concern is security configuration. The example sets gateway.controlUi.allowInsecureAuth to true and gateway.controlUi.dangerouslyDisableDeviceAuth to true, and it falls back to the token my-openclaw-token when OPENCLAW_APP_TOKEN is not set. The page does not explain the consequences of these choices. Treat the example as a starting point for a throwaway sandbox, not a hardened production setup.

Who it is for

It suits developers who already use, or are willing to use, E2B sandboxes and who want a Telegram-facing OpenClaw agent. The code is written against the E2B SDK in TypeScript and Python, and the page assumes you are comfortable with environment variables, running shell commands from code and creating a Telegram bot.

It is not aimed at readers who want a no-code setup, who want to run OpenClaw outside E2B, or who want to use a model provider other than OpenAI. The page's flow and troubleshooting assume OpenAI.

What the guide lets you do

Following the page, you would: create an E2B sandbox from the openclaw template; set the OpenClaw primary model to openai/gpt-5.2; enable the Telegram plugin; add a Telegram channel with your bot token; start the OpenClaw gateway as a background, long-running process; have a Telegram user message the bot to get a pairing code; and approve that user from the sandbox.

It also shows how to check state afterwards: openclaw channels list --json, openclaw channels status --json --probe, openclaw pairing list --json --channel telegram and openclaw channels logs --channel telegram --lines 200. A note says you do not need to open the gateway URL in a browser for Telegram. The gateway is used as the channel runtime.

Using it

Requirements

The page lists three prerequisites: a Telegram bot token from @BotFather (created with the /newbot command), an OpenAI API key for the OpenClaw model, and an E2B API key configured locally.

The code also implies a local runtime for the E2B SDK (Node.js with the e2b package for the TypeScript example, Python with the e2b package for the Python example) and access to an E2B template named openclaw. The page does not say how that template is built or provided, which SDK versions work, or which operating systems are supported for the local machine. Those details are unknown from this page.

How it works

The local script uses the E2B SDK to create a sandbox with Sandbox.create('openclaw', ...), passing OPENAI_API_KEY and TELEGRAM_BOT_TOKEN as sandbox environment variables and a timeout of 3,600,000 ms in TypeScript or 3600 seconds in Python. It then runs OpenClaw CLI commands inside the sandbox through sandbox.commands.run.

The CLI commands set agents.defaults.model.primary to openai/gpt-5.2, enable plugins.entries.telegram.enabled, and register the bot with openclaw channels add --channel telegram --token "$TELEGRAM_BOT_TOKEN". The page says the Telegram plugin must be enabled before the channel is added.

A background command sets the two gateway.controlUi options and starts openclaw gateway --allow-unconfigured --bind lan --auth token --token <token> --port 18789. The gateway acts as the long-running process that serves the Telegram channel. A loop then polls up to 45 times, one second apart, using ss -ltn to see when port 18789 is listening.

When a new Telegram user messages the bot, the bot replies that access is not configured and shows the user's Telegram id and a pairing code (shown on the page as the placeholder XXXXXXXX). The bot owner approves the code from the sandbox with openclaw pairing approve --channel telegram <code>. The page says openclaw pairing approve telegram <code> also works. The page does not describe how OpenClaw routes messages to the model beyond the model setting, or how conversation state is stored.

Setup steps

1. Create a Telegram bot with @BotFather and keep the token. 2. Get an OpenAI API key and configure your E2B API key locally. 3. Export OPENAI_API_KEY and TELEGRAM_BOT_TOKEN (and optionally OPENCLAW_APP_TOKEN) in the environment where you run the script. 4. Run the TypeScript or Python quick-start script. It creates the sandbox, sets the model, enables the Telegram plugin, adds the channel, starts the gateway in the background and waits for the port. 5. Send a message such as hi to your bot in Telegram and note the pairing code it returns. 6. Approve the code from the sandbox with the pairing command. 7. Use the status, pairing list and logs commands to check the result.

The Python example reads the two keys with os.environ[...], so the script stops with an error if either variable is missing. The TypeScript example reads process.env values without a check. The page does not say what happens if a key is missing there.

Worked example from the page

The core of the TypeScript quick start is: const sandbox = await Sandbox.create('openclaw', { envs: { OPENAI_API_KEY: process.env.OPENAI_API_KEY, TELEGRAM_BOT_TOKEN: process.env.TELEGRAM_BOT_TOKEN }, timeoutMs: 3600_000 }); then await sandbox.commands.run('openclaw config set plugins.entries.telegram.enabled true'); then await sandbox.commands.run('openclaw channels add --channel telegram --token "$TELEGRAM_BOT_TOKEN"'). The gateway is started with { background: true } so the script can carry on and poll the port.

After the user receives a pairing prompt in Telegram, the approval step is await sandbox.commands.run(`openclaw pairing approve --channel telegram ${PAIRING_CODE}`). The Python version mirrors this with sandbox.commands.run(f"openclaw pairing approve --channel telegram {PAIRING_CODE}"). The page gives no sample output from a successful run, so what a working bot reply looks like is not shown.

Assessment & evidence

Limitations and risks

Security: the example sets allowInsecureAuth and dangerouslyDisableDeviceAuth to true on the gateway UI configuration and binds the gateway to lan. The page does not say whether the port is reachable from outside the sandbox or what an attacker could do with the gateway. If OPENCLAW_APP_TOKEN is unset, the gateway token is the public example value my-openclaw-token. Use a strong, private token. Review these options before using anything beyond a disposable test.

Lifetime: the sandbox is created with a one-hour timeout. The page does not say what happens to the bot when the sandbox ends, how to keep it running longer, or whether pairing approvals and configuration survive. Treat the bot as short-lived unless you confirm otherwise.

Scope: the page covers only OpenAI as the model provider and one Telegram flow. It does not describe group chats, multiple users, access revocation, rate limits, message privacy or what data is sent to OpenAI. The troubleshooting list has four entries. Beyond them, error handling is not documented.

Evidence: the page says this is the working flow the authors used, but it gives no tested versions or dates. Nothing was run for this report.

Reasoning behind the assessment

The page is classed as a learning resource because it teaches a deployment procedure rather than shipping a tool. It is specific and complete enough to follow: it gives exact commands, an ordering rule (enable the Telegram plugin before adding the channel), a readiness check and a pairing process.

Confidence is limited because everything rests on the page text. The commands, flags, model name and template name were not checked against OpenClaw or E2B at the time of capture, and the page has no date or version. The insecure-auth settings are noted as a risk because their names mark them as unsafe and the page offers no explanation.

Alternatives

The page does not compare itself with other approaches. It links to a related E2B page on running OpenClaw's web gateway with token auth. That page was not part of the captured evidence, so its content is not assessed here.

The page does not document other hosting arrangements or compare other chat channels; their feasibility, requirements and tradeoffs are unknown from this page.

Evidence used

The report uses one captured file: the full text of the E2B documentation page at [https://docs.e2b.dev/agents/openclaw/openclaw-telegram.md] (6,614 bytes). It includes the introduction, prerequisites, TypeScript and Python quick-start code, the pairing walkthrough and approval code, status and log commands, and the troubleshooting list.

The page's header points to a documentation index at [https://docs.e2b.dev/llms.txt]. That index was not captured and was not used. All claims here come from the page text. No claim was checked by running code or against the live E2B, OpenClaw, OpenAI or Telegram services.

Access & freshness

Costs

The page states no prices. It requires an E2B API key, an OpenAI API key and a Telegram bot token, but it does not say what any of them cost, whether free tiers exist, or how E2B sandbox time or OpenAI model usage is billed. The cost of running this setup is therefore unknown from this page.

Two behaviours may affect spend, but the page does not quantify them. The sandbox is created with a one-hour timeout. Every chat message answered by the bot would presumably use the configured OpenAI model, openai/gpt-5.2. Check the E2B and OpenAI pricing pages before running it.

Rights and licence

The captured page text contains no licence statement, copyright notice or reuse terms for the documentation or the code samples. Rights to copy, adapt or redistribute the page are therefore unknown from this evidence. The page also does not state the licence of OpenClaw or of the E2B SDK. Check the E2B documentation repository or terms, and the OpenClaw project, before copying the samples into your own product or documentation.

Freshness

The page was captured on 2026-11-15. The captured text carries no publication or update date, no OpenClaw version and no E2B SDK version. The only pinned version-like detail is the model identifier openai/gpt-5.2. Whether that model, the openclaw template or the CLI flags are still current is unknown. OpenClaw and E2B are separate projects that can change commands or defaults, so compare the commands with the current docs before relying on them.

Suggested next steps

Before starting: check E2B and OpenAI pricing, and use a bot token and API keys you can revoke. Set OPENCLAW_APP_TOKEN to a long random value instead of relying on the default. Decide whether you accept the two insecure gateway options, and look up what they do in the OpenClaw documentation.

While following the guide: run the steps in order. The Telegram plugin must be enabled first. After sending a first message to the bot, approve only the pairing code you recognise. Then run channels list, channels status --probe and pairing list to confirm the result. Use channels logs if the bot stays silent.

Afterwards: confirm what happens when the one-hour sandbox timeout ends, and rotate any keys you used for testing.

Evidence for this report

selected-page.txtselected · checked 2026-11-15