Skip to main content

Skill Knowledge Graph

Capability-token enforcement for LLM-synthesized procedures. The runtime is the gate, not the manifest.

Hero

SKG sits between an LLM agent and the operations it wants to perform. On every host call, the Wasmtime runtime physically prevents anything the grant set does not include. Recurring tasks resolve through a local router and skip the LLM entirely.

Three measured numbers (full methodology in paper.md):

  • 528 input tokens saved per task (~36%) on a 200-task corpus, 95% bootstrap CI [442, 628].
  • 0.16 ms p50 routing latency vs 3082 ms p50 for the LLM call.
  • 13 of 13 attacks contained vs 5 of 13 for a declared-capability baseline.

Install

One command (pipx or uv tool). Skips the venv-and-clone dance.

pipx install git+https://github.com/bdube83/skill-knowledge-graph
# or:
uv tool install git+https://github.com/bdube83/skill-knowledge-graph

That puts skg and skg-mcp on your PATH. Verified this turn: skg --version -> skg 0.1.0 from ~/.local/bin/skg.

Wire it into your LLM CLI

skg install --client claude-code --write     # writes ~/.claude.json
skg install --client copilot --write         # writes ~/.copilot/mcp-config.json
codex mcp add skg -- $(which skg-mcp)        # codex uses TOML, registers via its own CLI

The hosts now expose three tools: skg_route, skg_execute, skg_list_nodes.

Or use it as a CLI directly

For scripts, CI, and one-off use without an MCP host.

skg run "draft a reviewer ping for PR review"
skg run --vendor copilot "summarise the last 10 commits"
skg run --json --dry-run "any task"

skg run routes through SKG, falls back to the configured vendor on a miss, and prints the result.

For development

When you want to edit the package itself:

git clone https://github.com/bdube83/skill-knowledge-graph
cd skill-knowledge-graph
python3.13 -m venv .venv
.venv/bin/pip install -e .

What you get

Nodes are Rust crates compiled to WASI. Each ships with a manifest that lists requested capabilities. The launcher mints a per-run handle table, wires only the host imports the grant set permits, then runs Wasmtime. A node that imports a host function it was not granted fails at instantiate-time.

Twelve generic effect classes plus text.generate: local.read/write, network.read/write, external.draft/send, browser.read/write, git.read/write, secret.read, production.write. Three of them require an approval token at call time.

The router runs four stages in order: exact, full-text search, vector, graph composition. The first three are local; the fourth expands typed edges in the graph.

Three honest limits

  • The 36% token saving holds on long-context tasks. On short-context tasks the 120-token routing header costs more than the LLM call. Below 120 tokens per task LLM input, SKG adds overhead. Source: eval/results/h1_stats.json.
  • The vector stage gets 0 of 200 hits today. The bottleneck is the placeholder local-hash-v1 embedding, not the pipeline.
  • Graph composition is not yet quantitatively tested; deferred to a follow-up paper.

Tests

.venv/bin/python -m pytest tests/ -q
# 242 tests on commit 5daee75

Code layout

Path Contents
skg/ Kernel, router, runtime, MCP server, CLI, baselines, host adapters.
nodes/ Three reference Rust-WASI crates.
eval/ Corpus, runners, statistical scripts.
tests/ Pytest suite.
figures/ Architecture diagram source and renders.
docs/ Integration guide and paper-reproduction guide.
paper.md / paper.pdf The accompanying paper.

Citation

@misc{dube2026skg,
  title  = {Skill Knowledge Graph: Capability-Token Enforcement for LLM-Synthesized Procedures},
  author = {Dube, Bongani},
  year   = {2026},
  note   = {Paystack. Draft},
  url    = {https://github.com/bdube83/skill-knowledge-graph}
}

License

Apache 2.0. See LICENSE.

Metadata

Release files for skg 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skg 0.1.0
File Size Uploaded Provenance
skg-0.1.0.tar.gz 861.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for skg 0.1.0
File Interpreter ABI Platform
skg-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 939.6 kB

Release files / skg-0.1.0.tar.gz

Download URL skg-0.1.0.tar.gz
Size 861.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e199e48c0f93fe55be3cddbc8f18cc773f2d5d642955708dc749fd22d9ed9af0
BLAKE2b-256 checksum
How to use checksums
b0e4385ae2fdda1067359bcced2ec798fca140c8af68f24c46f1bc79c15ef8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / skg-0.1.0-py3-none-any.whl

Download URL skg-0.1.0-py3-none-any.whl
Size 78.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5adb132842888e91d8329be8e1324bbfbc41584800a20d5ca383c6a197ab3f79
BLAKE2b-256 checksum
How to use checksums
6858ea73d5f47b55062b90fa0bffdaee19f76bb4773ffa9b8cc02fc770ed68e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for skg 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page