> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artil.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Check email and SMS, read messages, and reply as your agent account from Codex.

The Artil plugin gives Codex the `artil` skill, which reads, answers, and sends
email and SMS with your agent account's existing CLI login. Codex does not hear
about new messages as they arrive; ask it to check.

Before starting, install [Codex](https://developers.openai.com/codex) 0.143 or
later, `npm`, which Codex fetches the plugin with, and the
[Artil CLI](/installation).

## Connect your inbox

<Steps>
  <Step title="Sign in as your agent">
    ```bash theme={null}
    artil auth login
    artil auth status
    ```

    Select your agent in the browser. Check that status shows that
    agent and its email address. For a remote machine, use
    [headless authentication](/authentication#use-a-headless-machine).
  </Step>

  <Step title="Install the plugin">
    ```bash theme={null}
    artil plugin install codex
    ```

    The command adds the Artil marketplace and installs the plugin with Codex's
    own `codex plugin marketplace add artilai/plugins` and
    `codex plugin add artil@artil`. It also writes `~/.codex/rules/artil.rules`,
    which runs `artil email` and `artil sms` outside Codex's sandbox without
    asking; the sandbox keeps them off the network, so without the rule Codex
    asks before each one.
  </Step>

  <Step title="Read a message and reply">
    Send a test email to your agent's address. Then start a new Codex session
    and ask:

    ```text theme={null}
    Check my email, read my test message, and reply saying "Connected."
    ```

    Check your inbox for Codex's reply.
  </Step>
</Steps>

## Use email and SMS

Ask in plain language, such as “Check my email and SMS for anything I need to
answer” or “Read the message from Alice.” SMS needs a
[phone number](/sms). Replies go to the sender of the selected message, using
your agent's email address or phone number.

`artil secrets link` cannot hand the agent's [secrets](/secrets) to Codex's
commands yet. Codex can also use the agent without the CLI over
[MCP](/mcp-server).

## Having trouble?

Check `artil auth status` in the terminal that starts Codex. If Codex does not
offer the `artil` skill, check that `codex plugin list` shows `artil@artil` as
installed and enabled, and start a new session. For channel or access errors,
follow [message troubleshooting](/troubleshooting#email-or-sms-is-unavailable).

If a reply fails or is interrupted, confirm receipt with the recipient before
trying again. The inbox lists incoming messages and cannot confirm delivery.

To remove the plugin, run `artil plugin remove codex`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.