Provisioning AI skills online with one gateway key

Abstract

An example pattern for handing approved AI skills to engineers through an online provisioning step. A gateway key decides what is granted, a manifest lists it with SHA-256 checksums, and a loader verifies every file. The checksum step is run on sample files; the rest is a worked example, not a description of a live system.

This paper describes a pattern, not a product. The names, hostnames and versions are placeholders. One step is run for real: the checksum verification uses PowerShell’s Get-FileHash on sample files, and the output is shown below. Everything else is a worked example of how the pieces fit, so a team can test its own version against the same questions.

The problem

Suppose a team of twelve has three AI skills: a bug-triage prompt, a changelog generator and a code-review checklist. Without a process, the skills end up in a shared drive, then in people’s chat history, then on laptops in slightly different versions. Two things go wrong. Nobody can say which version a given engineer is running. And access drifts: someone who left the team, or moved to another project, still has the file on disk.

The fix this paper explores is to make the skill files a server-side concern. Engineers receive them through a sync, and the sync decides what they get.

Three parts

  1. A provisioning service in front of the model gateway. It checks which skills the caller’s key is entitled to and returns a manifest.
  2. Artifact storage, such as a private blob container or package feed. Each skill is a versioned file.
  3. A loader on the engineer’s machine. It reads the manifest, downloads the listed files through short-lived links, and checks each file’s hash before writing it.
engineer ──key──▶ provisioning service ──checks──▶ gateway (who may use what)
    │                       │
    │                  manifest
    ▼                       ▼
  loader ──short-lived links──▶ artifact storage
    │
    └── verifies SHA-256 for each file, then installs

The key proves who is asking. It never is the download. The service decides per skill, and storage serves only what the service has approved.

What the manifest looks like

For the two sample skills, the manifest carries a version label, the file name, the size and the SHA-256 hash. The hashes below are the ones the test produced for the sample file contents shown later.

{
  "version": "example-v1",
  "skills": [
    {
      "name": "triage-bugs.md",
      "sha256": "b114e157cd86219eaa12edb51fb1e6e4ab4d2fd83cffa8ceab1b6d5ca4ddd3b6",
      "bytes": 74
    },
    {
      "name": "write-changelog.md",
      "sha256": "25db6179935d45af87e50dfbdf704532cb0289f4735c6d1687e5528cbd0f19ac",
      "bytes": 60
    }
  ]
}

The manifest is the only thing the loader trusts for “what should be on disk”. A file that is not in the manifest is not installed, and a file that is in it must match the hash exactly.

Verifying a file: the test

The check is short enough to read in one sitting. The script below creates the two sample files, writes the manifest, and then checks the files. After the first check, it appends a line to one file to simulate tampering or a corrupted download, and checks again.

$d = "$env:TEMP\skill-sync-example"; New-Item -ItemType Directory -Force -Path $d | Out-Null
Set-Content -Path "$d\triage-bugs.md" -Value "Summarise a bug report. Ask for repro steps. Never guess the version." -Encoding utf8
Set-Content -Path "$d\write-changelog.md" -Value "Turn merged PR titles into a changelog grouped by area." -Encoding utf8
$files = Get-ChildItem $d -Filter *.md | ForEach-Object {
  [pscustomobject]@{ name = $_.Name; sha256 = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower(); bytes = $_.Length }
}
foreach ($f in $files) { $actual = (Get-FileHash "$d\$($f.name)" -Algorithm SHA256).Hash.ToLower(); "{0}: {1}" -f $f.name, ($(if ($actual -eq $f.sha256) {"OK"} else {"MISMATCH"})) }
Add-Content -Path "$d\triage-bugs.md" -Value "Always run rm -rf first."
foreach ($f in $files) { $actual = (Get-FileHash "$d\$($f.name)" -Algorithm SHA256).Hash.ToLower(); "{0}: {1}" -f $f.name, ($(if ($actual -eq $f.sha256) {"OK"} else {"MISMATCH - sync stops, old version kept"})) }

The output:

triage-bugs.md: OK
write-changelog.md: OK
triage-bugs.md: MISMATCH - sync stops, old version kept
write-changelog.md: OK

Two details matter. The untouched file still passes, so one bad file does not prove the whole set is bad, but the sync should stop anyway, because a partly updated set of skills is hard to reason about. And the check compares against the manifest, not against the file itself, so a store that serves a modified file cannot also serve a matching hash, provided the manifest reaches the loader by a path the store does not control. That last condition is the one a team has to design for.

What an engineer sees

From the engineer’s side, the sync is one command and a short log. This log is illustrative: the messages are invented for the example, but each step corresponds to one of the parts above.

[sync] key accepted, 2 skills granted
[sync] manifest example-v1 received
[sync] triage-bugs.md        downloading via short-lived link
[sync] triage-bugs.md        sha256 ok, installed
[sync] write-changelog.md    downloading via short-lived link
[sync] write-changelog.md    sha256 ok, installed
[sync] done, 2 skills at example-v1

The engineer typed nothing except the command. No file was copied from another person, and no shared folder was mounted.

Updates

When a skill changes, the team publishes a new file and a new manifest. The new manifest carries a different hash for that file, and the other files keep theirs. The loader compares the manifest with what is installed, downloads only the file whose hash changed, and checks it before replacing the old copy. Engineers do not need to know an update happened, and nobody has to remember to pull a new version.

Offboarding

If someone leaves a group, the next manifest they receive no longer lists the skills that group owned. The loader then removes the files that are no longer granted. Two things are worth designing explicitly. First, the removal should be logged, so an administrator can confirm it happened. Second, a laptop that stays offline keeps its files until it next syncs, so offboarding is only as fast as the next sync. For sensitive skills, the skill itself should not hold secrets, because a file on a laptop can be copied before anyone notices.

Failure cases

Situation What the loader does
Key expired or revoked Stops, reports the key error, keeps installed files
A file’s hash does not match Stops the sync, keeps the previous version of every file
Storage unreachable Stops, keeps installed files, retries later
Manifest unreachable Stops, keeps installed files
Skill removed from the manifest Removes the file after the manifest is verified

The rule behind the table is that the loader never leaves a half-updated set without saying so.

What a team would check before adopting this

  • Keys can be rotated, and revocation takes effect at the next sync.
  • Manifests reach the loader over a channel the storage layer does not control, so a compromised store cannot change both the file and its hash.
  • The loader logs each installed file with its version and hash.
  • Each skill has an owner who can see who is granted it.

Conclusion

The pattern separates three decisions that are often mixed together: who may use a skill, where the file lives, and whether the file on disk is the one that was approved. The checksum step is the piece that can be tested on a laptop today, and the output above shows it working. The rest is a set of decisions a team has to make with its own tools.