Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(runtime): protect HF_TOKEN and defer the Hugging Face scan preset (#277)

NielsRogge3f31707a3818
diff --git a/sdk/typescript/docs/cli.md b/sdk/typescript/docs/cli.md
index 0bab8bd77..97c610d03 100644
--- a/sdk/typescript/docs/cli.md
+++ b/sdk/typescript/docs/cli.md
@@ -235,6 +235,15 @@ export CHEAPER_INFERENCE_API_KEY="<your-cheaper-inference-api-key>"
codex-security scan . --provider cheaperinference --model gpt-5.4
```
+### Hugging Face compatibility
+
+The bundled Codex 0.166.0 scanner sends its scan-completion tool inside a
+`namespace` and can request `web_search`. Hugging Face's published Responses
+implementation accepts `function` and remote `mcp` tool declarations. A named
+Hugging Face scan provider is deferred until the scanner and router can exchange
+the tools a complete scan requires. [Hugging Face's implementation notes](https://huggingface.co/docs/inference-providers/en/guides/gpt-oss#responses-api)
+and [request schema](https://github.com/huggingface/responses.js/blob/0e3e84c469a9f59ad16e2eb3a0d6f1c4de637a7b/src/schemas.ts#L219-L232).
+
### Amazon Bedrock
Use AWS credentials and a region with access to the exact Bedrock model ID:
diff --git a/sdk/typescript/src/runtime.ts b/sdk/typescript/src/runtime.ts
index 6e3cdc902..bab01f806 100644
--- a/sdk/typescript/src/runtime.ts
+++ b/sdk/typescript/src/runtime.ts
@@ -132,6 +132,7 @@ const PLUGIN_HELPER_SECRET_ENVIRONMENT_VARIABLES = new Set([
"OPENROUTER_API_KEY",
"FIREWORKS_API_KEY",
"CHEAPER_INFERENCE_API_KEY",
+ "HF_TOKEN",
]);
const PREPARE_SCAN_ARTIFACT_RESTORER_PROGRAM = `
from pathlib import Path
diff --git a/sdk/typescript/tests-ts/runtime.test.ts b/sdk/typescript/tests-ts/runtime.test.ts
index 8453a829c..1b116b013 100644
--- a/sdk/typescript/tests-ts/runtime.test.ts
+++ b/sdk/typescript/tests-ts/runtime.test.ts
@@ -5354,6 +5354,7 @@ describe("runtime directories and plugin Python boundary", () => {
"assert os.environ.get('CODEX_API_KEY') is None",
"assert os.environ.get('OPENROUTER_API_KEY') is None",
"assert os.environ.get('FIREWORKS_API_KEY') is None",
+ "assert os.environ.get('HF_TOKEN') is None",
'payload = sys.stdin.buffer.read().decode("utf-8")',
String.raw`assert payload == "\n\0" + "出力" * (32 * 1024)`,
"print(json.dumps({'ok': True, 'label': '出力', 'inputLength': len(payload), 'details': 'x' * (5 * 1024 * 1024)}, ensure_ascii=False))",
@@ -5370,6 +5371,7 @@ describe("runtime directories and plugin Python boundary", () => {
CODEX_API_KEY: "also-must-not-reach-python",
OPENROUTER_API_KEY: "openrouter-must-not-reach-python",
FIREWORKS_API_KEY: "fireworks-must-not-reach-python",
+ HF_TOKEN: "huggingface-must-not-reach-python",
},
},
args,