# OpenAI Codex Approval Notifications on Your Phone

> Review permission requests in Codex Remote, or use an alert-only PingRoom hook to know when a local Codex session needs you.

- Published: 2026-11-30
- Author: PingRoom
- Category: Developers
- Topics: OpenAI Codex approval notifications, Codex PermissionRequest hook, Codex permission alerts on phone
- Canonical: https://pingroom.io/blog/openai-codex-approval-notifications
- Cover image: https://pingroom.ams3.cdn.digitaloceanspaces.com/blog/openai-codex-approval-notifications/openai-codex-approval-notifications-cover.webp
- Cover description: Two teammates look toward a phone in a linen tray beside Pingo on a kitchenette counter.

If you want to approve a Codex permission request from your phone, connect your computer to [Codex Remote in the ChatGPT app](https://developers.openai.com/blog/mastering-codex-remote-for-engineering). You can inspect the request and decide in the connected session.

If you just want your phone to tell you to come back to a local Codex session, a `PermissionRequest` hook can send a short Ping to a private PingRoom Room. Open Codex to see the request and make the decision there.

| You want to know…                                             | Use                                                                               |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| What is Codex asking permission to do, and should I allow it? | The Codex prompt on your computer or in Codex Remote.                             |
| Is my local Codex session waiting for permission?             | The PingRoom alert below, for shell requests in one trusted project.              |
| Did Codex finish the turn?                                    | The [Codex turn completion guide](/blog/codex-turn-complete-phone-notifications). |

PingRoom wrote this guide. If Codex Remote already gives you the prompt you need on your phone, use it on its own.

## Set up a private Room for the alert

Create a private test Room that only you can access. In **Connections**, add an **Incoming webhook** and copy its URL. It works like a password: anyone with the URL can send into the Room. Keep it in the local environment used to start Codex. The [PingRoom webhook reference](/documents/webhooks) includes setup and plan limits. Free allows one active incoming webhook across the Rooms you own. Pro lifts that account-wide limit.

Use a current local Codex CLI that supports [the `PermissionRequest` hook](https://learn.chatgpt.com/docs/hooks#permissionrequest), plus Python 3, on macOS or Linux. The example below watches Bash permission prompts in one project. Start with a disposable project and enable PingRoom notifications on your phone.

## Send a fixed message from the hook

Save this as `codex-permission-ping.py` outside your project. The script reads the event type and tool name. The webhook gets the same title and message every time. Commands, paths, request details, and session identifiers stay local.

```python
import json
import os
import re
import sys
from urllib.error import URLError
from urllib.request import HTTPRedirectHandler, Request, build_opener


class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None


def main():
    try:
        event = json.load(sys.stdin)
    except (ValueError, OSError):
        return

    if not isinstance(event, dict):
        return
    if event.get("hook_event_name") != "PermissionRequest" or event.get("tool_name") != "Bash":
        return

    url = os.environ.get("PINGROOM_CODEX_APPROVAL_WEBHOOK_URL", "")
    if not re.fullmatch(
        r"https://api\.pingroom\.io/api/webhooks/[A-Za-z0-9_-]+/[A-Za-z0-9_-]+",
        url,
    ):
        return

    request = Request(
        url,
        data=json.dumps(
            {
                "title": "Codex needs permission",
                "message": "Open your Codex session to review the request.",
                "action": None,
            }
        ).encode("utf-8"),
        headers={"Content-Type": "application/json"},
        method="POST",
    )
    try:
        with build_opener(NoRedirect).open(request, timeout=2):
            pass
    except (URLError, OSError):
        return


if __name__ == "__main__":
    main()
```

The hook tries one POST, skips redirects, and leaves stdout empty. Codex still handles the permission prompt. The short network timeout and five-second hook limit keep an unavailable webhook from holding up the prompt for long. Add the hook once so the same request does not trigger two copies.

## Enable it in one project

Add this group under `hooks` in that project's `.codex/hooks.json`. Merge it with any existing entries. Replace both example paths with absolute paths for your Python installation and local script.

```json
{
  "hooks": {
    "PermissionRequest": [
      {
        "matcher": "^Bash$",
        "hooks": [
          {
            "type": "command",
            "command": "'/absolute/path/to/python3' '/absolute/path/to/codex-permission-ping.py'",
            "timeout": 5
          }
        ]
      }
    ]
  }
}
```

Load `PINGROOM_CODEX_APPROVAL_WEBHOOK_URL` from your local secret manager or enter it without echo in a Bash or Zsh terminal. Launch Codex from the same terminal. The URL stays out of the command text and the project.

```sh
printf 'PingRoom webhook URL: '
IFS= read -rs PINGROOM_CODEX_APPROVAL_WEBHOOK_URL
printf '\n'
export PINGROOM_CODEX_APPROVAL_WEBHOOK_URL
codex
unset PINGROOM_CODEX_APPROVAL_WEBHOOK_URL
```

In the Codex CLI, open `/hooks`. Review the exact command and trust it for this test. Keep your usual [Codex approval policy](https://learn.chatgpt.com/docs/agent-approvals-security).

![Two teammates look at a laptop while Pingo stands on two books beside a face-down phone.](https://pingroom.ams3.cdn.digitaloceanspaces.com/blog/openai-codex-approval-notifications/openai-codex-approval-notifications-1.webp)

In this illustration, [Pingo the Pigeon](/Pingo), PingRoom’s fictional Chief Marketing Officer, watches the phone go face-down when it’s time to read the actual request.

## Rehearse a denial

Wait for a harmless shell action that already needs permission in your test session. For example, in a disposable workspace you could ask Codex to request permission to write a blank file outside the workspace. Use a throwaway destination you control, and deny the request.

1. Check that the phone shows **Codex needs permission** and the generic body. The Ping contains no command or file name.
2. Open Codex, inspect the request, and deny it in Codex. Check that the file was never created.
3. In a new session with the webhook variable unset, repeat with another disposable filename. You should still get the native approval prompt. This time the Room stays quiet.

The adapter was tested with synthetic hook input and mocked HTTP. Try the denial in your own session before relying on the alert. If a Ping arrives late, check the current Codex session for a pending request.

[Create a private test Room](/app/rooms) and try the hook with one disposable project.

_The two editorial illustrations were created with AI using approved PingRoom character references._
