Make E2B Code Execution
Use this skill when the user wants code to become a durable tool.
Known E2B module id: the E2B sandbox module is
"module": "e2b:RunE2BSandbox"
with
.
The architecture is:
text
Hermes writes code -> Code folder -> local execution or Make E2B Code Shell -> E2B runtime
If that code needs SaaS data, it must call a Make API shell scenario from
make-api-shell-connection-workflow
. Do not put OAuth secrets, Make API tokens,
E2B API keys, refresh tokens, provider passwords, or direct provider SDK auth in
generated code.
Storage Rule
Store all durable code artifacts below the configured Hermes Code folder:
- local knowledge store:
knowledge/hermes/Code/...
- Google Drive knowledge store:
Use the runtime helper, for example:
python
import make_api_shell as make
make.write_code_artifact(
"tools/calc.py",
"print(17 * 23)\\n",
language="python",
confirm=True,
)
Do not write durable code files directly with shell redirection,
, or
unless the user explicitly asked for a temporary local
scratch file.
Execution Modes
Plain Code Execution
Use this for quick, non-hosted code:
- Write the code artifact under .
- Run it with the local tool.
- Write a short run note or output artifact only through the configured
Knowledge helper.
Hosted E2B Code Shell
Use this when the code should become a reusable hosted tool:
- Write the code artifact under .
- Create or reuse a Make scenario that matches the E2B Code Shell contract.
- Run the shell with , , , , , and
.
- Treat the E2B shell output as the tool result.
The Make scenario is the control-plane shell. E2B is only the runtime. The
agent never receives E2B credentials.
Building the shell on the verified Make app (verified live)
When no infrastructure runner URL is available, build the E2B Code Shell as an
app-action shell on the Make-verified app
("e2b.dev", beta, major
version 0), module
:
- Module mapper fields: (/),
(/), (array), (number,
required), (text, required). Map inputs from the standard shell
interface as .
- The connection comes from a credential request for /
. Bind it twice: as legacy (required by the
shell verifier) and as the module's declared parameter —
manifest-2/SDK modules ignore and otherwise run without
credentials. In helper environments pass
connection_parameter="account"
to create_app_action_shell_scenario
.
- Patch the scenario interface to the generic shell contract before the first
run, then activate the scenario.
- The module's output field is with shape
{"stdout": ["..."], "stderr": []}
— map ReturnData as
{"data": "{{<moduleId>.logs}}"}
(// do not exist
and silently return null). Use in helper environments.
- Editing the scenario in the Make UI renumbers module ids and rewrites
the module parameters (dropping ). After any UI edit, re-read
the blueprint, re-bind the connection both ways, and fix the ReturnData
reference to the new module id — a stale reference returns
on otherwise successful runs.
- E2B error fingerprints from the module:
401: authorization header is missing
means the module sent no key (connection not bound);
401: authorization header is malformed
means the stored apiKey does not
start with — common causes: a "Bearer " prefix, quotes, the
Access Token pasted instead of the API Key, or a UI save that
silently did not persist (fix via POST /connections/{id}/set-data
). The
e2b app sends raw, so store the bare key.
Nested SaaS Access
For “inception” tools, generated code may call Make API shell scenarios:
text
Hosted code -> Make Gmail API shell -> Gmail API
The hosted code should receive only scenario IDs, paths, request payloads, and
non-secret input data. It must never receive raw Make or provider credentials.
References
- Execution modes
- E2B Code Shell scenario contract