GATEHOUSE — SHARED DEMO

START HERE: THIS PACKAGE CONNECTS CODEX IN TERMINAL
Opening this folder as a project in the Codex desktop app does not activate
Gatehouse. Starting plain `codex` also uses your normal provider settings.
Run `python3 connect.py` in your operating system's Terminal and type your test
prompts into the Codex session that it opens. Desktop routing requires separate
provider configuration; this package deliberately leaves those settings alone.

Chat
Open your administrator's HTTPS link and choose Connect. Enter your personal
Gatehouse team key. No OpenAI credential or ChatGPT subscription is needed.
Try the synthetic examples and compare Original with Sent to model in the
Privacy inspector. Your key and conversation remain in tab memory only.

Codex CLI (macOS / Linux; Windows via WSL)
1. Install Python 3.11+. The launcher finds Codex CLI in PATH or, on macOS,
   inside the installed ChatGPT/Codex desktop app. You do not need another CLI
   installation when that bundled copy is available. Otherwise install the CLI:
   https://developers.openai.com/codex/cli/
2. Unzip this package and open Terminal in the gatehouse-client directory.
3. Check your connection:
   python3 connect.py doctor
4. Start a read-only demo session:
   python3 connect.py
5. Ask: Read support-ticket.txt and draft a short acknowledgement without identifiers.
   Then ask in that SAME Terminal session: What's the email id of the customer?
6. Exit Codex, then inspect gateway receipts:
   python3 connect.py receipts

The launcher asks for your team key privately on each run. For an existing
key file, use --key-file /path/to/team.key (permissions must be 600).
It does not edit your global Codex settings. The fixture is synthetic.
The launcher checks for the CLI before asking for a key. If your app is in a
custom location, select its CLI with GATEHOUSE_CODEX_BIN, for example:
  GATEHOUSE_CODEX_BIN="/absolute/path/to/codex" python3 connect.py
This package requires a Codex version supporting custom Responses providers
and model_catalog_json; the administrator should provide the tested version.
Verified on 2026-10-18 with Codex CLI 0.162.0-alpha.17.2 over public HTTPS.

What to check
- In the launched Codex session, /status should show the Gatehouse provider and
  demo-chat model. `doctor` reports the CLI path/version and checks API access;
  it does not verify desktop app routing or send an inference request.
- Receipts show provider=openai and model=gpt-5.4-mini.
- A request after reading the ticket records email, SSN and card redactions.
- The displayed allowance decreases by actual provider token usage.
- An administrator-issued one-token test key produces budget_exceeded (429),
  with no provider dispatch. A blocked request does not consume model tokens.

Scope
PII checks currently cover emails, plausible US SSNs, and checksum-valid card
numbers. Other sensitive data may pass. Model replies are not scrubbed.
The local client and shell see the original file; the gateway scrubs text
before it reaches OpenAI. A local file/tool transcript can display the original
email; this is not a screen-redaction or employee file-access control feature.
Model replies are not filtered on return, so an invented email is also possible.
Use a fresh session and an unpredictable synthetic address when checking whether
the model received the original. Never infer routing from a polite first reply;
confirm the gateway receipt. Hosted search, images and external integrations are
disabled in this demo profile. Context is limited to 32K and output to 2K.
Daily token allowances reset at midnight UTC and are not currency caps.
The gateway operator pays provider usage; treat your team key as a password.
