Unified AI Gateway
Overview
Use the official unified-ai-system MCP server to inspect and exercise a local
AI gateway without provider credentials. This skill file provides operating
guidance; it does not install the server or change Codex configuration by
itself. The official Codex plugin bundles the MCP definition, while skill-only
installations require the manual setup below.
Prerequisites And Setup
- Confirm that Codex CLI and Docker are installed and Docker is running.
- If the eight tools are already visible, skip setup and do not register a
duplicate server.
- Explain the first stage: it downloads the reviewed immutable linux/amd64
image into Docker's cache, inspects its metadata and layer history, creates
but never starts a temporary container, exports its root filesystem, removes
that temporary container, and writes an inspection inventory to a temporary
directory. Obtain explicit user approval for those download and inspection
changes only.
- After that first approval, pull the reviewed platform manifest and complete
the inspection. Do not execute the image or register it yet:
IMAGE='ghcr.io/happy520ai/unified-ai-system/mcp-server@sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee'
PLATFORM='linux/amd64'
REVIEW_DIR="$(mktemp -d)"
docker pull --platform "$PLATFORM" "$IMAGE"
docker image inspect "$IMAGE" --format 'Id={{.Id}} OS={{.Os}} Architecture={{.Architecture}} User={{json .Config.User}} Entrypoint={{json .Config.Entrypoint}} Cmd={{json .Config.Cmd}} Labels={{json .Config.Labels}}'
docker image history --no-trunc "$IMAGE" > "$REVIEW_DIR/image-history.txt"
REVIEW_CONTAINER="$(docker create --platform "$PLATFORM" --pull never --entrypoint /bin/true "$IMAGE")"
docker export --output "$REVIEW_DIR/rootfs.tar" "$REVIEW_CONTAINER"
docker rm "$REVIEW_CONTAINER"
tar -tf "$REVIEW_DIR/rootfs.tar" > "$REVIEW_DIR/rootfs-files.txt"
mkdir -p "$REVIEW_DIR/rootfs"
tar --same-permissions -xf "$REVIEW_DIR/rootfs.tar" -C "$REVIEW_DIR/rootfs"
find "$REVIEW_DIR/rootfs/app" -type f -print > "$REVIEW_DIR/app-files.txt"
find "$REVIEW_DIR/rootfs/app" \( -type l -o -type f -links +1 \) -exec ls -ld {} + > "$REVIEW_DIR/app-links.txt"
find "$REVIEW_DIR/rootfs/app" -type f -name '*.node' -exec sha256sum {} + > "$REVIEW_DIR/native-binaries.sha256"
find "$REVIEW_DIR/rootfs" -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -print > "$REVIEW_DIR/executable-files.txt"
find "$REVIEW_DIR/rootfs" -type f \( -perm -4000 -o -perm -2000 \) -print > "$REVIEW_DIR/suid-sgid-files.txt"
find "$REVIEW_DIR/rootfs/app" -type f \( -name '.env' -o -name '.env.*' -o -name '*.pem' -o -name '*.key' -o -name '*.p12' -o -name '*.pfx' -o -name 'id_rsa*' \) -print > "$REVIEW_DIR/credential-like-files.txt"
find "$REVIEW_DIR/rootfs/app" -type f -name package.json -exec grep -nHE '"(preinstall|install|postinstall|prepare|prepack|postpack)"' {} + > "$REVIEW_DIR/lifecycle-hooks.txt"
grep -RInE 'child_process|spawn\(|fetch\(|AI_GATEWAY_MCP_URL|process\.env|writeFile|appendFile|unlink|rm\(' "$REVIEW_DIR/rootfs/app/packages/mcp-server/src" "$REVIEW_DIR/rootfs/app/packages/shared-sdk/src" > "$REVIEW_DIR/runtime-sensitive-code.txt"
If sha256sum is unavailable, use the platform's SHA-256 utility and preserve
the same report. Keep the review directory until the report is accepted; its
deletion is another filesystem change and requires approval for the exact path.
Read every generated inventory and report the inspection before proceeding.
Compare it with the versioned
image content review.
Require linux/amd64 manifest digest
sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee,
config digest
sha256:c28166511ca9d95ab6f4c0c8ac0cbc2acbbfdac20f971d074ff6744d39e0248f,
source https://github.com/happy520ai/unified-ai-system, revision
541430d68fac6b35c512ea7d2df20fe45334e0a5, version 0.3.2, license
Apache-2.0, entrypoint docker-entrypoint.sh, and command
node packages/mcp-server/src/index.js.
Report these reviewed risks explicitly: the image uses the default root
user; includes Debian shell/package utilities and 11 base-image SUID/SGID
files; contains 549 internal pnpm links, two native Node binaries, and eight
lifecycle-hook declarations; and starts a child gateway with loopback HTTP.
The optional AI_GATEWAY_MCP_URL can make an HTTP or HTTPS connection only
when explicitly passed. The registered command below passes no host files,
environment variables, or ports and disables container networking. Stop on
any mismatch, unexpected link, credential-like file, native binary, hook,
privileged file, or sensitive-code behavior.
Explain the second stage: it persists a Codex MCP configuration and permits
Codex to launch the inspected image in a later task. Obtain a separate
explicit approval for registration and activation; the download approval
does not carry over.
After that second approval, register the reviewed platform digest with
pulling, container networking, Linux capabilities, and privilege escalation
disabled, then inspect the stored configuration:
codex mcp add unified-ai-system -- docker run --rm -i --pull never --platform linux/amd64 --network none --cap-drop ALL --security-opt no-new-privileges ghcr.io/happy520ai/unified-ai-system/mcp-server@sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee
codex mcp get unified-ai-system --json
- Restart Codex or open a new task, then use
/mcp verbose to confirm that all
eight tools are available. Remove the registration when it is no longer
wanted:
codex mcp remove unified-ai-system
Removing the registration does not remove the pulled image from Docker's
cache. Treat image-cache deletion as a separate host-state change and obtain
approval before doing it.
When to Use This Skill
- Use when a user asks whether Unified AI System is healthy or ready.
- Use when a user wants a credential-free gateway chat proof.
- Use when a user asks about the gateway's knowledge, workflow, or workforce
surfaces.
- Use when a user wants evidence from the bundled MCP tools rather than a claim
inferred from documentation or process exit codes.
Do not use this skill for generic model comparisons, unrelated MCP servers, or
deploying a production gateway.
Workflow
- Confirm that the
unified-ai-system MCP tools are available in the current
task. If they are absent, follow the approved setup above and wait for a
restarted or new task.
- Call
gateway_health, then gateway_readiness, before attempting chat.
- Select the narrowest additional tool that answers the request.
- Report returned provider, execution mode, readiness, and blockers exactly.
- Separate transport success from product, production-readiness, autonomy, or
AGI claims.
Tool Map
gateway_health: managed gateway status and provider mode
gateway_readiness: chat-path readiness and blockers
gateway_chat: deterministic credential-free chat proof
knowledge_readiness: knowledge subsystem readiness
workflow_health: workflow subsystem status
workflow_actions: available workflow actions
workforce_health: workforce subsystem status
workforce_agents: available workforce agents
Example
User: Check whether the local gateway is ready, then prove chat works safely.
Agent:
1. Call gateway_health.
2. Call gateway_readiness.
3. Call gateway_chat only if both results prove fake-provider mode.
4. Report provider, model, execution mode, response, and every blocker.
Safety Boundaries
- Keep the credential-free local fake provider as the default.
- Never request, read, or transmit provider credentials through this skill.
- Do not enable or call a real provider without explicit scoped authorization.
- Treat MCP registration, image pulls, container creation, networking, and
teardown as host-state changes that require informed user approval.
- Never substitute a mutable tag, the multi-platform index, or an unreviewed
platform manifest for the reviewed linux/amd64 digest. Keep download and
inspection approval separate from registration and activation approval.
- Keep
--pull never in the registered command. If the reviewed image is
absent from the local cache, fail closed and return to the first approval
stage.
- Keep
--network none, --cap-drop ALL, and
--security-opt no-new-privileges in the registered command.
- Do not claim production readiness, L5 autonomy, or AGI from a healthy handshake.
- Treat a zero exit code as transport evidence, not proof that readiness gates
passed.
Limitations
- This skill file does not bundle the MCP server, Docker image, or Codex
configuration. It only operates tools supplied by the separately installed
official integration.
- It does not deploy, benchmark, or certify the gateway for production use.
- The credential-free chat tool proves only the deterministic local fake path.
- It does not configure real providers or handle provider credentials.
- The published MCP image requires Docker.
- The reviewed
0.3.2 path is limited to linux/amd64. Do not activate an arm64
or other platform image without a separate content review.
- The image runs as the container's default root user and bundles the gateway
source, package-manager tooling, native dependencies, and base-image
SUID/SGID files. The registered command drops capabilities, prevents new
privileges, disables networking, and leaves the image in Docker's cache.
- Existing Codex tasks may not hot-load a newly installed MCP configuration.
Troubleshooting
- If the tools are missing after approved registration, inspect
codex mcp get unified-ai-system --json, then restart Codex or start a new
task.
- If readiness is blocked, report the returned blocker instead of retrying chat
blindly.
- If the runtime might use a real provider, stop before chat and keep the
session read-only.
Additional Resources
1---2name: unified-ai-gateway3description: Operate and evaluate Unified AI System through eight governed MCP tools while preserving fake-provider, authorization, and evidence boundaries.4license: Apache-2.05---67# Unified AI Gateway89## Overview1011Use the official `unified-ai-system` MCP server to inspect and exercise a local12AI gateway without provider credentials. This skill file provides operating13guidance; it does not install the server or change Codex configuration by14itself. The official Codex plugin bundles the MCP definition, while skill-only15installations require the manual setup below.1617## Prerequisites And Setup18191. Confirm that Codex CLI and Docker are installed and Docker is running.202. If the eight tools are already visible, skip setup and do not register a21 duplicate server.223. Explain the first stage: it downloads the reviewed immutable linux/amd6423 image into Docker's cache, inspects its metadata and layer history, creates24 but never starts a temporary container, exports its root filesystem, removes25 that temporary container, and writes an inspection inventory to a temporary26 directory. Obtain explicit user approval for those download and inspection27 changes only.284. After that first approval, pull the reviewed platform manifest and complete29 the inspection. Do not execute the image or register it yet:3031```bash32IMAGE='ghcr.io/happy520ai/unified-ai-system/mcp-server@sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee'33PLATFORM='linux/amd64'34REVIEW_DIR="$(mktemp -d)"3536docker pull --platform "$PLATFORM" "$IMAGE"37docker image inspect "$IMAGE" --format 'Id={{.Id}} OS={{.Os}} Architecture={{.Architecture}} User={{json .Config.User}} Entrypoint={{json .Config.Entrypoint}} Cmd={{json .Config.Cmd}} Labels={{json .Config.Labels}}'38docker image history --no-trunc "$IMAGE" > "$REVIEW_DIR/image-history.txt"3940REVIEW_CONTAINER="$(docker create --platform "$PLATFORM" --pull never --entrypoint /bin/true "$IMAGE")"41docker export --output "$REVIEW_DIR/rootfs.tar" "$REVIEW_CONTAINER"42docker rm "$REVIEW_CONTAINER"4344tar -tf "$REVIEW_DIR/rootfs.tar" > "$REVIEW_DIR/rootfs-files.txt"45mkdir -p "$REVIEW_DIR/rootfs"46tar --same-permissions -xf "$REVIEW_DIR/rootfs.tar" -C "$REVIEW_DIR/rootfs"47find "$REVIEW_DIR/rootfs/app" -type f -print > "$REVIEW_DIR/app-files.txt"48find "$REVIEW_DIR/rootfs/app" \( -type l -o -type f -links +1 \) -exec ls -ld {} + > "$REVIEW_DIR/app-links.txt"49find "$REVIEW_DIR/rootfs/app" -type f -name '*.node' -exec sha256sum {} + > "$REVIEW_DIR/native-binaries.sha256"50find "$REVIEW_DIR/rootfs" -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -print > "$REVIEW_DIR/executable-files.txt"51find "$REVIEW_DIR/rootfs" -type f \( -perm -4000 -o -perm -2000 \) -print > "$REVIEW_DIR/suid-sgid-files.txt"52find "$REVIEW_DIR/rootfs/app" -type f \( -name '.env' -o -name '.env.*' -o -name '*.pem' -o -name '*.key' -o -name '*.p12' -o -name '*.pfx' -o -name 'id_rsa*' \) -print > "$REVIEW_DIR/credential-like-files.txt"53find "$REVIEW_DIR/rootfs/app" -type f -name package.json -exec grep -nHE '"(preinstall|install|postinstall|prepare|prepack|postpack)"' {} + > "$REVIEW_DIR/lifecycle-hooks.txt"54grep -RInE 'child_process|spawn\(|fetch\(|AI_GATEWAY_MCP_URL|process\.env|writeFile|appendFile|unlink|rm\(' "$REVIEW_DIR/rootfs/app/packages/mcp-server/src" "$REVIEW_DIR/rootfs/app/packages/shared-sdk/src" > "$REVIEW_DIR/runtime-sensitive-code.txt"55```5657If `sha256sum` is unavailable, use the platform's SHA-256 utility and preserve58the same report. Keep the review directory until the report is accepted; its59deletion is another filesystem change and requires approval for the exact path.60615. Read every generated inventory and report the inspection before proceeding.62 Compare it with the versioned63 [image content review](https://github.com/happy520ai/unified-ai-system/blob/2967617bb266c79992a6ed40e70bb59e67f661ca/docs/security/mcp-image-review-0.3.2.md).64 Require linux/amd64 manifest digest65 `sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee`,66 config digest67 `sha256:c28166511ca9d95ab6f4c0c8ac0cbc2acbbfdac20f971d074ff6744d39e0248f`,68 source `https://github.com/happy520ai/unified-ai-system`, revision69 `541430d68fac6b35c512ea7d2df20fe45334e0a5`, version `0.3.2`, license70 `Apache-2.0`, entrypoint `docker-entrypoint.sh`, and command71 `node packages/mcp-server/src/index.js`.7273 Report these reviewed risks explicitly: the image uses the default root74 user; includes Debian shell/package utilities and 11 base-image SUID/SGID75 files; contains 549 internal pnpm links, two native Node binaries, and eight76 lifecycle-hook declarations; and starts a child gateway with loopback HTTP.77 The optional `AI_GATEWAY_MCP_URL` can make an HTTP or HTTPS connection only78 when explicitly passed. The registered command below passes no host files,79 environment variables, or ports and disables container networking. Stop on80 any mismatch, unexpected link, credential-like file, native binary, hook,81 privileged file, or sensitive-code behavior.826. Explain the second stage: it persists a Codex MCP configuration and permits83 Codex to launch the inspected image in a later task. Obtain a separate84 explicit approval for registration and activation; the download approval85 does not carry over.867. After that second approval, register the reviewed platform digest with87 pulling, container networking, Linux capabilities, and privilege escalation88 disabled, then inspect the stored configuration:8990```bash91codex mcp add unified-ai-system -- docker run --rm -i --pull never --platform linux/amd64 --network none --cap-drop ALL --security-opt no-new-privileges ghcr.io/happy520ai/unified-ai-system/mcp-server@sha256:cc17e923335f953631f59fb6a5ffcdce0e12e16c5abf362f1d28747452adadee92codex mcp get unified-ai-system --json93```94958. Restart Codex or open a new task, then use `/mcp verbose` to confirm that all96 eight tools are available. Remove the registration when it is no longer97 wanted:9899```bash100codex mcp remove unified-ai-system101```102103Removing the registration does not remove the pulled image from Docker's104cache. Treat image-cache deletion as a separate host-state change and obtain105approval before doing it.106107## When to Use This Skill108109- Use when a user asks whether Unified AI System is healthy or ready.110- Use when a user wants a credential-free gateway chat proof.111- Use when a user asks about the gateway's knowledge, workflow, or workforce112 surfaces.113- Use when a user wants evidence from the bundled MCP tools rather than a claim114 inferred from documentation or process exit codes.115116Do not use this skill for generic model comparisons, unrelated MCP servers, or117deploying a production gateway.118119## Workflow1201211. Confirm that the `unified-ai-system` MCP tools are available in the current122 task. If they are absent, follow the approved setup above and wait for a123 restarted or new task.1242. Call `gateway_health`, then `gateway_readiness`, before attempting chat.1253. Select the narrowest additional tool that answers the request.1264. Report returned provider, execution mode, readiness, and blockers exactly.1275. Separate transport success from product, production-readiness, autonomy, or128 AGI claims.129130## Tool Map131132- `gateway_health`: managed gateway status and provider mode133- `gateway_readiness`: chat-path readiness and blockers134- `gateway_chat`: deterministic credential-free chat proof135- `knowledge_readiness`: knowledge subsystem readiness136- `workflow_health`: workflow subsystem status137- `workflow_actions`: available workflow actions138- `workforce_health`: workforce subsystem status139- `workforce_agents`: available workforce agents140141## Example142143```text144User: Check whether the local gateway is ready, then prove chat works safely.145146Agent:1471. Call gateway_health.1482. Call gateway_readiness.1493. Call gateway_chat only if both results prove fake-provider mode.1504. Report provider, model, execution mode, response, and every blocker.151```152153## Safety Boundaries154155- Keep the credential-free local fake provider as the default.156- Never request, read, or transmit provider credentials through this skill.157- Do not enable or call a real provider without explicit scoped authorization.158- Treat MCP registration, image pulls, container creation, networking, and159 teardown as host-state changes that require informed user approval.160- Never substitute a mutable tag, the multi-platform index, or an unreviewed161 platform manifest for the reviewed linux/amd64 digest. Keep download and162 inspection approval separate from registration and activation approval.163- Keep `--pull never` in the registered command. If the reviewed image is164 absent from the local cache, fail closed and return to the first approval165 stage.166- Keep `--network none`, `--cap-drop ALL`, and167 `--security-opt no-new-privileges` in the registered command.168- Do not claim production readiness, L5 autonomy, or AGI from a healthy handshake.169- Treat a zero exit code as transport evidence, not proof that readiness gates170 passed.171172## Limitations173174- This skill file does not bundle the MCP server, Docker image, or Codex175 configuration. It only operates tools supplied by the separately installed176 official integration.177- It does not deploy, benchmark, or certify the gateway for production use.178- The credential-free chat tool proves only the deterministic local fake path.179- It does not configure real providers or handle provider credentials.180- The published MCP image requires Docker.181- The reviewed `0.3.2` path is limited to linux/amd64. Do not activate an arm64182 or other platform image without a separate content review.183- The image runs as the container's default root user and bundles the gateway184 source, package-manager tooling, native dependencies, and base-image185 SUID/SGID files. The registered command drops capabilities, prevents new186 privileges, disables networking, and leaves the image in Docker's cache.187- Existing Codex tasks may not hot-load a newly installed MCP configuration.188189## Troubleshooting190191- If the tools are missing after approved registration, inspect192 `codex mcp get unified-ai-system --json`, then restart Codex or start a new193 task.194- If readiness is blocked, report the returned blocker instead of retrying chat195 blindly.196- If the runtime might use a real provider, stop before chat and keep the197 session read-only.198199## Additional Resources200201- [Unified AI System](https://github.com/happy520ai/unified-ai-system)202- [60-second Codex MCP quickstart](https://github.com/happy520ai/unified-ai-system/blob/master/docs/codex-mcp-quickstart.md)203- [MCP server guide](https://github.com/happy520ai/unified-ai-system/blob/master/packages/mcp-server/README.md)204- [MCP image content review](https://github.com/happy520ai/unified-ai-system/blob/2967617bb266c79992a6ed40e70bb59e67f661ca/docs/security/mcp-image-review-0.3.2.md)