Codex Inkbox Plugin
Give your Codex agent its own Inkbox identity:
a mailbox, iMessage, a phone number for calls and SMS, and an internet address.
Step away from the keyboard and keep working with it from anywhere.
Email · Calls · SMS / MMS · iMessage · WhatsApp · Tunnel
Prerequisites
- Codex installed and logged in. The bridge drives a real Codex session, so the
codex CLI has to be on the machine and authenticated — install it (developers.openai.com/codex), then either sign in with a ChatGPT/Codex login or set OPENAI_API_KEY. inkbox-codex doctor checks for it.
- Python 3.11+. The installer finds one and builds the bridge its own venv.
- macOS or Linux. Boot persistence uses a systemd user unit on Linux and a launchd agent on macOS.
- An Inkbox agent — nothing to set up in advance; the setup wizard self-signs up for you (or takes an existing API key).
Get started — one command
This finds a Python 3.11+, installs the bridge in its own venv, puts inkbox-codex on your PATH, and runs the setup wizard:
curl -fsSL https://raw.githubusercontent.com/inkbox-ai/codex-plugin/main/install.sh | bash
That's the whole setup. The wizard creates a fresh Inkbox agent for you (or takes an existing API key), provisions a phone number, connects iMessage, mints a webhook signing key, picks the project directory Codex works in, and offers to keep the bridge running on every boot. When it finishes, text/email/call your agent and it answers from a real Codex session.
The one thing to have ready: be logged into Codex — a ChatGPT/Codex login (via the Codex app/CLI) or OPENAI_API_KEY set. The installer checks this and warns if it's missing.
Flags: --start (launch the background gateway when done), --no-setup (install only). From a local checkout, run ./install.sh. Re-running is safe.
Bootstrap an existing identity without prompts
For unattended agent setup, install without opening the wizard and pass the API key through the environment (or standard input), never a command-line argument:
curl -fsSL https://raw.githubusercontent.com/inkbox-ai/codex-plugin/main/install.sh | bash -s -- --no-setup
export INKBOX_API_KEY="ApiKey_..."
inkbox-codex bootstrap --identity my-agent --project-dir "$PWD" \
--voice-ai --rotate-signing-key --start-gateway
unset INKBOX_API_KEY
bootstrap validates that the key can access exactly the requested identity, scopes down an admin key before saving it, preserves existing Voice AI settings, enables native Inkbox tool approvals, and starts or restarts the detached gateway. Signing-key replacement is opt-in because it transfers verified webhook delivery away from any gateway using the previous key. The command prints a secret-redacted JSON result and is safe to resume.
Check it any time:
inkbox-codex doctor # config, codex CLI/auth, identity reachability
inkbox-codex status # is the background gateway up? where are the logs?
What it does
you (phone) ── SMS / iMessage / email / call ──▶ Inkbox ──▶ tunnel ──▶ bridge
│
▼
Codex session
(full tool access in
your project dir)
Text, iMessage, email, or call your agent's Inkbox number. Each remote party gets one Codex session spanning every channel — text it on the walk home, then email it details, same conversation.
Codex runs with full tool access in CODEX_PROJECT_DIR. It reads, searches, and browses freely; anything risky (running commands, editing files) is escalated to you as a text:
Codex wants to run the command: npm test
Reply 1 (or YES) to allow once, 2 (or SESSION) to allow for this session, 3 (or NO) to deny. /stop cancels the task.
When Codex needs you to pick between options (the AskUserQuestion tool), you get a numbered poll on whatever channel you're on, and your reply is fed back as the answer.
Each message you send is tagged with its channel, so Codex knows whether it's on SMS, iMessage, email, or a call.
A channel prompt is appended to Codex's system prompt so replies fit a phone: plain text on phone channels, readable mrkdwn on Slack, short replies, jargon kept to a minimum ("saved and published the change", not "pushed to origin/main").
Codex also gets Inkbox tools (inkbox_send_email, inkbox_send_sms, inkbox_send_imessage, …) so it can proactively reach you — "email me the full report" works.
Manual install
If you'd rather not run the installer (any Python 3.11+ environment):
pip install -e .
inkbox-codex setup # interactive wizard — writes .env for you
set -a; source .env; set +a
inkbox-codex doctor
inkbox-codex run
inkbox-codex setup walks you through everything and writes .env: create a fresh Inkbox agent via self-signup (or bring an existing API key), pick or create the identity, attach the Codex avatar, provision a phone number, wait for your START opt-in, choose a phone-call voice stack, connect iMessage, mint a webhook signing key, choose the project directory, choose whether to trust Inkbox MCP tools without repeated allow prompts, and set up autostart. Realtime keys are validated before selection is saved. An admin key used to change Voice AI authority is held only for that setup run and is never written to .env. Rerun setup anytime to reconfigure.
Local Docker test image
The repository includes a manual-test image with Codex, the plugin, and the
Inkbox SDK preinstalled. It reuses the host's native Codex login and keeps
Inkbox plugin state in a named volume; neither is copied into the image:
docker build -t inkbox-codex-local .
docker run -dit --name inkbox-codex-local \
-v "${CODEX_HOME:-$HOME/.codex}:/root/.codex" \
-v "$PWD:/workspace" \
-v inkbox-codex-state:/root/.inkbox-codex \
inkbox-codex-local
docker exec -it inkbox-codex-local bash
# inside the container
inkbox-codex setup
inkbox-codex doctor
inkbox-codex run
# after leaving the container
docker rm -f inkbox-codex-local
The image contains no credentials. If you use API-key authentication instead
of codex login, add -e OPENAI_API_KEY="$OPENAI_API_KEY" to docker run.
Inkbox credentials are entered into setup or supplied only at runtime.
On startup the bridge opens an Inkbox tunnel, wires mail/text/iMessage webhook subscriptions and the incoming-call channel to it, and routes everything into Codex sessions.
Running it
inkbox-codex run # foreground (Ctrl+C to stop) — good for first runs and debugging
Or run it as a background daemon (PID + log under ~/.inkbox-codex/):
inkbox-codex start # detach and run in the background
inkbox-codex status # is it running? where are the logs?
inkbox-codex restart # restart it
inkbox-codex stop # graceful stop (SIGTERM, then SIGKILL after 5s)
tail -f ~/.inkbox-codex/gateway.log
start auto-loads .env from the current directory, so you don't have to source it first. run is the foreground version a service manager (systemd, Docker) should supervise; start/stop are the self-contained background option.
Start on boot
The setup wizard offers to keep the bridge running for you — either just in the background for this session, or as a service that starts on every boot. On Linux it installs a systemd user unit (~/.config/systemd/user/inkbox-codex.service) and enables it; on macOS it installs a launchd agent. To keep a Linux service alive while you're logged out, enable lingering once:
sudo loginctl enable-linger "$USER"
systemctl --user status inkbox-codex # restart | stop | status
Uninstall
inkbox-codex uninstall # stop it, remove the boot service + launcher; keep config
inkbox-codex uninstall --purge # also delete ~/.inkbox-codex (config, logs, sessions)
This is local-only — webhook subscriptions on the Inkbox side are left as-is; remove them in the Inkbox Console if you want.
Then, from your phone:
- Text
START to the agent's number (first time only, carrier opt-in).
- Text it something like "clean up the TODOs in the auth module".
- Approve the permission texts as they arrive. Get the result as a text.
How escalation works
The bridge honors Codex's configured approval policy and relays its requests over your active Inkbox channel:
- Commands, file changes, permission-profile changes, and request-user-input prompts block the agent mid-turn while the bridge texts you a one-line plain-language summary.
- MCP tool approvals number the available choices consecutively; reply with the number shown or a word from the table below. A different instruction cancels the pending approval turn and becomes fresh work instead of being consumed as an approval answer.
- Request-user-input prompts are formatted as numbered options; reply with the number or free text.
- No reply within
INKBOX_PERMISSION_TIMEOUT_S (default 10 min) cancels an MCP request; command/file approvals are denied.
- Approval prompts state their reply window and send an expiry notice. A late choice on the same conversation route, while no new approval is pending, is rejected instead of becoming a new task; ask for the action again to receive a new request.
- Communication approvals put recipients before subject/content and omit idempotency and tracing fields. Only the supplied display metadata is shown; raw tool arguments are not exposed.
| Reply |
Decision |
YES |
Allow once |
SESSION |
Allow for this session, when offered by Codex |
NO |
Deny this request |
ALWAYS |
Remember approval across sessions, when offered by Codex |
/stop / /cancel |
Cancel the entire task |
For example, a tool offering only allow-once and deny displays 1 — Allow once
and 2 — Deny. If session approval is also available, it displays 1 — Allow
once, 2 — Allow for this session, and 3 — Deny. Always follow the numbers
in the current prompt; words such as NO keep the same meaning.
Session and permanent approval are distinct: an unavailable scope is never
silently changed to allow-once. Advertised MCP persistence scopes are forwarded
through Codex's native protocol, not a bridge-wide allow list. Other tools still
require their own approval when Inkbox tool auto-approval is enabled.
Clear replies such as “yes, proceed” are accepted. A natural cancellation such as
“please cancel my request” stops the task. Companion answers and controls retain
sender and mention gates. Structured MCP questions show their actual fields and
return typed answers; unsupported forms require using Codex directly or canceling
the interaction. URL-based requests require completing the displayed URL step
before replying DONE.
Slack preview
Set INKBOX_SLACK_ENABLED=true to add Slack to the gateway. Inkbox SDK 0.7.29 or newer
includes the required Slack methods; the API must also support Slack. Connect a
workspace to the same Inkbox identity to exchange messages; the receiver can
start before installation.
Run inkbox-codex setup to opt in interactively. The wizard offers Connect Slack
now?, selects a saved provisioning workspace, waits for app preparation, prints
an installation link to open in your browser, and polls until that workspace is
connected. Keep the link private and complete authorization in the same browser.
This flow requires an SDK exposing client.slack.list_provisioning_workspaces
and identity-wide webhook subscriptions. Setup uses the bridge's existing claimed
agent key for workspace credentials, app preparation, and installation; no extra
admin key is needed. A newly self-signed-up identity must be claimed first. An
organization admin key is also supported when already configured for the bridge.
If you need to add a provisioning workspace or renew its credentials, the wizard
prompts for a masked Slack app-configuration access/refresh token pair from
Your App Configuration Tokens. Inkbox verifies and
stores the pair for your organization; the bridge does not save it locally.
If the pair is rejected, setup explains the credential issue and offers another
attempt without leaving the wizard. Other errors identify the failed step and
HTTP status when available; they do not silently retry app creation or expose tokens.
These are not bot tokens. Each identity's app is permanently bound to one
workspace. Existing connections need no new installation; manage permission
refreshes in the Inkbox console. After installation, add the bot to the channels
where you want to use it.
Existing connections are shown on reruns. You can skip connecting, press Ctrl+C
during either wait, or rerun after the five-minute wait expires. Rerunning setup
and declining full reconfiguration still offers Slack onboarding. Declining Slack
turns it off only in this bridge; it does not disconnect the workspace or disable
Slack for other clients. On startup, the gateway registers the subscriptions below.
Work indicators.