Secure Skill Installation in Codex
Secure Skill Installation in Codex
Installing third-party Codex Skills is convenient.
But there’s also a risk:
A Skill is essentially a bundle of prompts, workflows, and tool-calling rules.
Once installed, external content can enter the Agent’s execution flow and context.
More importantly, some Skills may:
- call MCP servers
- request shell access
- alter workflows
- override system instructions
In practice:
1 | Installing a Skill |
To reduce that risk, I added a lightweight security gate for Codex Skill installation using SlowMist Agent Security.
Core Idea
The idea is simple:
Whenever a Skill is installed:
1 | review first |
A Skill is only allowed into:
1 | ~/.codex/skills |
after passing a security review with SlowMist Agent Security.
The entire process is triggered through AGENTS.md using on-demand policy loading, instead of permanently stuffing large security rules into the Agent context.
1. Install SlowMist Agent Security
Place slowmist-agent-security inside the Codex skills directory:
1 | ~/.codex/skills/slowmist-agent-security/ |
Directory structure:
1 | SKILL.md |
2. Add a Skill Installation Check Rule
Create:
1 | ~/.codex/skill-install-check.md |
Content:
1 | # Skill Installation Security Gate |
Using relative references like:
1 | @skills/... |
instead of absolute user paths makes the setup easier to migrate between environments.
3. Configure AGENTS.md for On-Demand Loading
Then update:
1 | ~/.codex/AGENTS.md |
with a single line:
1 | When installing any skill, first read and follow `@skill-install-check.md`. |
Why Not Put All Security Rules Directly in AGENTS.md?
Because large rule sets pollute the context window.
If full security policies are always present in the Agent context:
- everyday tasks become noisier
- token usage increases
- later rules become easier to ignore
- the Agent is more likely to overlook instructions
So this setup uses:
1 | on-demand policy loading |
The security rules are only loaded when the task involves:
1 | Skill installation |
At that point, Codex reads:
1 | @skill-install-check.md |
This keeps the workflow lighter and more reliable.
Final Workflow
After configuration, the Skill installation flow becomes:
1 | installation request |
Conceptually, this is a:
- conditional policy loading system
- soft security gate
- human-in-the-loop review workflow
It doesn’t require modifying Codex itself or building a complex sandbox.
But it can still significantly reduce the risk of:
- prompt injection
- malicious MCP integrations
- supply-chain contamination
- high-risk third-party Skills
Additional Notes
At the moment, this is still a:
1 | Soft Gate |
because it relies on Codex following AGENTS.md.
For stronger enforcement, the security review can be integrated directly into the Skill installation script itself:
1 | download |
That way, even if the Agent is affected by prompt injection, the installer itself can still prevent high-risk Skills from entering the system.