ワンクリックで
toolgate
Set up Toolgate in existing projects so coding agents can run selected CLIs through a sandboxed, gated command surface.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Set up Toolgate in existing projects so coding agents can run selected CLIs through a sandboxed, gated command surface.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | toolgate |
| description | Set up Toolgate in existing projects so coding agents can run selected CLIs through a sandboxed, gated command surface. |
Use this skill when a user wants an agent project to adopt Toolgate, especially in Node, Bun, or Python repositories.
Toolgate config is JSON. Prefer project-local scripts that generate JSON and then run:
toolgate run --config <preset files> --config <project config> --profile agent -- <agent command>
https://github.com/jmandel/toolgate by cloning the
main branch and building it with Cargo.direct: ["bash", "node", "npm"] or a map to
executable paths. Do not create presets for ordinary direct tools.gated, not direct.profile.session.env, profile.session.files, and
profile.session.mounts only for values that may be visible to the agent and
all direct tools. These use the same value shapes as gated tool config, but
they are not private per direct tool../.toolgate/repo/presets/github.json.presets.gh-runtime. It injects
GH_TOKEN from host gh auth token. Use gh-full only when the project
intentionally wants to mount the host GitHub CLI config./.toolgate, /.toolgate.generated.json, and /toolgate.local.json.allow: "all" as readonly or safe.toolSandbox.root: "host",
proc: true, or dev: "full" unless a tool actually needs that compatibility.Add scripts like this:
{
"scripts": {
"toolgate:fetch": "rm -rf ./.toolgate/repo && git clone https://github.com/jmandel/toolgate ./.toolgate/repo",
"toolgate:install": "npm run -s toolgate:fetch && cargo install --path ./.toolgate/repo --locked --force",
"toolgate:config": "node ./scripts/toolgate.config.mjs > ./.toolgate.generated.json",
"agent": "npm run -s toolgate:config && toolgate run --config ./.toolgate/repo/presets/github.json --config ./.toolgate.generated.json --profile agent -- ${AGENT:-codex}",
"agent:codex": "AGENT=codex npm run -s agent",
"agent:copilot": "AGENT=copilot npm run -s agent",
"agent:claude": "AGENT=claude npm run -s agent"
}
}
Add scripts/toolgate.config.mjs:
const config = {
profiles: {
agent: {
session: {
env: {
AGENT_TOKEN_FILE: "/tmp/session-auth/token"
},
files: {
"/tmp/session-auth/token": {
from: "hostCommand",
run: ["agent-cli", "auth", "token"]
}
}
},
gated: { gh: "presets.gh-runtime" },
direct: ["bash", "node", "npm"]
}
}
};
process.stdout.write(`${JSON.stringify(config, null, 2)}\n`);
Use the same Toolgate install/fetch scripts, but generate config with Bun when that fits the project:
{
"scripts": {
"toolgate:config": "bun ./scripts/toolgate.config.ts > ./.toolgate.generated.json",
"agent": "bun run toolgate:config && toolgate run --config ./.toolgate/repo/presets/github.json --config ./.toolgate.generated.json --profile agent -- ${AGENT:-codex}"
}
}
The generated profile should usually expose direct tools such as ["bash", "bun"].
Python projects can either keep a checked-in toolgate.local.json or generate
JSON from a tiny script:
python3 scripts/toolgate_config.py > .toolgate.generated.json
toolgate run --config ./.toolgate/repo/presets/github.json --config ./.toolgate.generated.json --profile agent -- codex
Use direct tools like ["bash", "python3"]. Keep pip, uv, or other
networked package tools gated if they need host auth or config.
After editing a project, verify:
npm run toolgate:install
npm run toolgate:config
toolgate resolve --config ./.toolgate/repo/presets/github.json --config ./.toolgate.generated.json --profile agent
npm run agent:codex -- --help
Swap agent:codex for agent:copilot or agent:claude when those are the
target CLIs.
More examples live in references/adoption-patterns.md.