skills-gateway
Governed, identity-aware server for Agent Skills (SKILL.md): OIDC + default-deny policy per fetch, immutable digest-verified versions, audit log, native sync…
Use it two ways: sgw sync alone, installing skills from a folder or a Git repo with no server to run, or with the gateway, which adds identity, per-fetch policy, immutable versions and an audit log. Agent Skills made the skill *format* portable: SKILL.md directories are now read natively by every mainstream coding agent. Distributing skills inside an organisation is still mostly file copying. Nothing records who may use which skill, pins what a project installed, or shows who fetched what. Skills Gateway adds that layer, and it is small enough to run as one binary:
Summary extracted from the README.
Skills Gateway
Governed, identity-aware distribution for Agent Skills. Publish a skill once. Every agent (Claude Code, Codex, Cursor, Copilot, Gemini CLI, Kiro, Windsurf) gets the skills its user is allowed to use, in the layout that agent expects, verified by digest.
Use it two ways: sgw sync alone, installing skills from a folder or a Git repo with no server to run, or with the gateway, which adds identity, per-fetch policy, immutable versions and an audit log.
WITHOUT A GATEWAY WITH SKILLS GATEWAY
one skills repo one skills repo
│ │ publish once
│ copy, symlink, paste ▼
├──► .claude/skills dev A ┌─────────────┐
├──► .cursor/skills dev B │ gateway │ who is asking?
├──► .agents/skills CI │ identity │ what may they load?
└──► ... laptop 4 │ + policy │ which version exactly?
└──────┬──────┘
· nobody knows who has what │ verified copy, recorded
· no way to keep one team out ├──► .claude/skills
· copies drift, silently ├──► .cursor/skills
· no record of who loaded what └──► .agents/skills
Status: v0.1, early. The API and the protocol spec can still change. Feedback and issues are welcome.
Why
Agent Skills made the skill format portable: SKILL.md directories are now read natively by every mainstream coding agent. Distributing skills inside an organisation is still mostly file copying. Nothing records who may use which skill, pins what a project installed, or shows who fetched what.
Skills Gateway adds that layer, and it is small enough to run as one binary:
- Identity on every request. Tokens from any OpenID Connect provider (Keycloak, Entra ID, Okta, Auth0, Cognito). Static tokens are available for development.
- Policy on every fetch. Rules are default-deny, and a deny always wins. They match on user, team, role and agent type, with namespace and name globs and semver ranges. Skills a caller may not fetch look exactly like missing skills.
- Immutable, digest-verified versions. A published version can never be overwritten. Its digest is computed from the files, not the archive, so it is stable, and clients verify it on download.
- Append-only audit. Every publish, deprecation and denied request is recorded, and each change is recorded in the same transaction as the change itself. Content reads (bundle, file, translate and MCP reads) are recorded too. Export the log as JSON Lines for your SIEM.
- Native delivery, with or without the server.
sgw syncwrites verified skills into each agent's own skills directory — in a project or in the home directory that serves every repo — and keeps a lock file of digests. Its source can be a folder, a Git repository or the gateway. The MCP endpoint implements the MCP Skills Extension (SEP-2640), and it also offers plain tools for MCP clients that do not support the extension yet.
How it works
One request, from token to answer
Every request walks the same four steps. A caller who may not have a skill is told it does not exist, so the policy itself cannot be used to discover what is hidden.
request ── Authorization: Bearer <token>
│
▼
┌──────────────────────────┐ OIDC (or a dev token) gives:
│ 1 IDENTITY │ subject · teams · roles · agent type
│ who is calling? │ the agent type comes from the token,
└────────────┬─────────────┘ never from a header a client could set
▼
┌──────────────────────────┐ rules match on namespace, name,
│ 2 POLICY │ version range and agent type
│ may they have it? │ a deny always wins
└────────────┬─────────────┘ nothing is allowed unless a rule says so
│
allow │ deny ────────► 404 not found
│ (identical to a skill that isn't there)
▼
┌──────────────────────────┐ published versions never change
│ 3 REGISTRY │ "latest" = newest version THIS caller
│ which version? │ may fetch, stable over pre-release
└────────────┬─────────────┘
▼
┌──────────────────────────┐ who, what, when, from where —
│ 4 AUDIT │ appended, never edited or deleted
└────────────┬─────────────┘
▼
the skill, three ways:
REST /v1 sgw sync MCP /mcp
bundle, files, writes agent skills/list, skills/get,
metadata folders directly list_skills, get_skill
Publishing: where the digest comes from
A skill is a folder, so the fingerprint covers every file in it, not just SKILL.md. It is built from the file contents, so re-zipping the same folder on another machine produces the same digest.
the skill folder each file hashed
┌───────────────────────┐
│ SKILL.md │ ──► sha256 599662b6…
│ references/ │
│ checklist.md │ ──► sha256 d7dff65b…
└───────────────────────┘
│
sorted list of "path + hash" for every file
│
▼
sha256:344413734f917ab6… ← the version's digest
│
┌────────────────────────┴────────────────────────┐
▼ ▼
stored with the version sent on every download,
and frozen forever and re-checked by the client
Sync: what lands in your project
sgw sync reads a short file listing the source, the skills and the agents you want. Nothing is written until every skill has been fetched and checked, so a failure never leaves half-written folders. The source is a gateway, a folder or a Git repository.
sgw-sync.yaml source your project
──────────────── ────── ────────────
formats: │
[claude, cursor] │ 1 resolve "latest" → 1.4.0
skills: │ 2 download that exact version
- platform/code-review ────────┤ 3 digest as promised?
- payments/refunds@1.2.0 │ │
│ no ─┴─► stop; nothing is written
│ yes
▼
translate on your machine
(from the bytes just verified)
│
├──► .claude/skills/code-review/…
├──► .cursor/skills/code-review/…
└──► sgw-lock.json
version + digest + file hashes
(commit it; the next sync checks
the same version still matches)
Two ways to use it
The same command installs skills either way, so a team can start without running anything and add governance later. Nothing about the output changes: same folders, same digests, same lock file.
WITHOUT A SERVER WITH THE GATEWAY
a folder or a git repo a gateway server
of SKILL.md directories identity · policy · audit
│ │
│ sgw sync │ sgw sync
▼ ▼
verified copies + sgw-lock.json verified copies + sgw-lock.json
in each agent's folders in each agent's folders
you get: one source, digests, you also get: who may fetch what,
pinned versions, no copying immutable versions, an audit log
Point the manifest at whichever source you have:
# sgw-sync.yaml — name exactly one source
path: ../team-skills # a folder of skill directories
# git: https://github.com/acme/skills # with optional ref: and dir:
# gateway: https://skills.example.com # or omit and set $SGW_URL
formats: [claude, cursor]
skills: ["*"] # or a list: [platform/code-review, payments/refunds@1.2.0]
Install into the project, or into your home directory where every agent reads them for every repo:
sgw sync # .claude/skills/, .cursor/skills/ … in this project
sgw sync -out ~ # ~/.claude/skills/, ~/.cursor/skills/ … for every repo
-out ~ writes the lock file to ~/sgw-lock.json.
Keeping them current
Installing skills once leaves them to go stale, and being out of date looks exactly like being up to date. One command ties a check to the moment skills are about to be used — the start of an agent session:
sgw hook install # writes a Claude Code SessionStart hook
sgw hook status # what is installed, and when it last ran
sgw hook remove # takes it out again
The hook is built to be ignorable:
- Cheap. At most one check per interval (
-every 4h), and that check is a singlegit ls-remote, one list request, or a directory scan. When the source has not moved, nothing is downloaded and nothing is written. - Never in the way. A failed check, an unreachable source or a missing network is silent, and the session starts normally.
- Quiet. Silent when nothing changed; one line when it updated something.
- Safe for authors. Sync never overwrites a file you edited after it was written; those are kept and reported.
sgw sync -forceoverwrites them deliberately.hook installalso warns about skill folders the source does not have, since those are usually unpublished work.
Cursor, Codex and Gemini CLI document their own hooks; sgw does not write those yet, and sgw hook status says so. Skill names must be unique across the skills you sync into one root, since every agent addresses a skill by its folder name.
One skill, without a manifest:
sgw fetch code-review -path ../team-skills -format cursor -out ~
sgw fetch code-review -git https://github.com/acme/skills -dir skills
What differs between the sources is what can be promised. A gateway publishes immutable versions, so a recorded digest must never change and sync treats a change as tampering. A folder or a moving branch legitimately changes, so sync records the new digest instead. A tag or a commit is fixed, so it is pinned like a gateway version.
Install
Download the archive for your machine from the
latest release,
unpack it, and put sgw on your PATH. Each release ships Windows, macOS and
Linux builds for amd64 and arm64, plus a checksums.txt to verify against:
# macOS / Linux
tar xzf sgw_0.1.0_darwin_arm64.tar.gz
shasum -a 256 -c checksums.txt --ignore-missing
./sgw version
The binaries are not code-signed, so Windows SmartScreen and macOS Gatekeeper will warn on first run. Verify the checksum instead of trusting the warning.
With a Go toolchain:
go install github.com/mthamil107/skills-gateway/cmd/sgw@latest
Quick start
# 1. Run a local gateway with development tokens (use OIDC in production)
cp examples/sgw.yaml sgw.yaml
export SGW_ADMIN_TOKEN=$(openssl rand -hex 24) SGW_DEV_TOKEN=$(openssl rand -hex 24)
sgw serve -config sgw.yaml &
# 2. Publish a skill
export SGW_URL=http://127.0.0.1:8080 SGW_TOKEN=$SGW_ADMIN_TOKEN
sgw publish examples/skills/code-review -ns platform -version 1.0.0
# 3. Find it and install it for Claude Code and Cursor
sgw list
sgw fetch platform/code-review -format claude
sgw fetch platform/code-review -format cursor
Or keep a manifest in the project and sync it (in CI or on checkout):
# sgw-sync.yaml
formats: [claude, codex, cursor]
skills:
- platform/code-review
- payments/refund-policy@1.2.0
sgw sync # verifies digests, writes files, updates sgw-lock.json
With Docker:
docker build -t skills-gateway .
docker run -p 8080:8080 -v $PWD/sgw.yaml:/etc/sgw/sgw.yaml -v $PWD/examples:/data/examples \
-e SGW_ADMIN_TOKEN -e SGW_DEV_TOKEN skills-gateway
In the container, set listen: 0.0.0.0:8080 in sgw.yaml.
Connect an MCP client
Point any MCP client that supports Streamable HTTP at http://<gateway>/mcp, with an Authorization: Bearer <token> header. For Claude Code:
claude mcp add --transport http skills http://127.0.0.1:8080/mcp \
--header "Authorization: Bearer $SGW_TOKEN"
The agent can then call list_skills, get_skill and read_skill_file. Clients that implement SEP-2640 use skills/list and skills/get directly, over skill://<namespace>/<name>/... URIs.
Policy
version: 1
rules:
- id: admins-everything
effect: allow
subject: { roles: [platform-admin] }
actions: [fetch, publish, deprecate, admin]
resource: { namespace: "*", name: "*" }
- id: everyone-reads-platform
effect: allow
subject: { any: true }
actions: [fetch]
resource: { namespace: platform, name: "*" }
- id: payments-team-owns-payments
effect: allow
subject: { teams: [payments] }
actions: [fetch, publish, deprecate]
resource: { namespace: payments, name: "*" }
- id: internal-skills-not-for-cursor-or-codex
effect: deny
subject: { agent_types: [cursor, codex] }
actions: [fetch]
resource: { namespace: platform, name: "internal-*" }
Agent type comes from a token claim (sgw_agent by default), never from a request header. The evaluator sits behind an interface, and its input document is {principal, action, resource}, so it can be swapped for OPA or Cedar.
Agent formats
| Format | Written to | Read by |
|---|---|---|
claude |
.claude/skills/<name>/ |
Claude Code (also Copilot and Windsurf) |
codex |
.agents/skills/<name>/ |
OpenAI Codex (also Windsurf) |
cursor |
.cursor/skills/<name>/ |
Cursor |
copilot |
.github/skills/<name>/ |
GitHub Copilot |
gemini |
.gemini/skills/<name>/ |
Gemini CLI |
kiro |
.kiro/skills/<name>/ |
Kiro |
windsurf |
.windsurf/skills/<name>/ |
Windsurf |
cursor-rules |
.cursor/rules/<name>.mdc |
Cursor legacy project rules (lossy; SKILL.md only) |
Directory locations follow each agent's documentation as of September 2026. Every target except cursor-rules is the unmodified skill directory, because the agents read SKILL.md natively.
API
- REST:
openapi.yaml, also served atGET /openapi.yaml. - Protocol, bundle and digest rules, and the MCP mapping:
docs/spec/skills-gateway-protocol.md.
How it compares
Several projects already cover parts of this space, and they are worth knowing:
| Project | What it is |
|---|---|
| MCP Gateway Registry | A registry and gateway for MCP servers, agents and skills: OAuth2/OIDC (Keycloak, Entra, Okta, Cognito), scanning, visibility controls. A larger deployment (nginx, FastAPI, MongoDB/DocumentDB). |
| agentregistry + agentgateway | A catalog of MCP servers, agents and skills, plus a policy-enforcing gateway. |
| SkillHub (iFlytek) | A self-hosted enterprise skill registry with RBAC, review and audit. |
| openskills, Skills Hub, AgentPort | Local tools that load, sync or convert skills across agents. |
Skills Gateway focuses on the narrower combination: a single small binary where identity and policy decide every individual fetch, published versions are immutable and digest-verified end to end, and the same governed catalog is served over REST, native sync and SEP-2640 MCP.
Roadmap
- v0.2: OPA/Cedar policy backends, scan-on-publish hooks (for example prompt-shield), a review state before publish.
- v0.3: signed skills (Sigstore), a GitHub App for Git-native sync, more translators.
- v0.4: PostgreSQL, a Helm chart, full-text search, a small admin UI.
Security
The gateway serves skill content and never executes it. Skills can still include scripts that agents run, so treat publish rights like commit rights. The spec's security considerations cover this in detail. See SECURITY.md to report a vulnerability.
Related work by the author
- prompt-shield: a prompt-injection firewall. Skills are a prompt-injection surface: Snyk's ToxicSkills audit (February 2026) found at least one security flaw in 36.8% of 3,984 skills from ClawHub and skills.sh.
- whotyped: detects AI agents at the SSH layer. Skills Gateway governs what agents load; whotyped observes what they did.
- Recuse Signal: measures whether LLM agents honour in-band governance signals.