Knowledge packs
Packs are curated YAML that ground the agents in known-good shapes instead of
whatever a model remembers. There are four families. All of them are Apache
2.0 and public in
trustacks-policy.
| Family | Directory | Answers | If one is missing |
|---|---|---|---|
| Framework | frameworks/ | What should a Dockerfile and CI workflow look like for this stack? | Analysis still runs; the proposal has no reference shape and usually stops at validation |
| Tool-action | tool-actions/ | Which GitHub Action, at which exact commit, runs this tool? | No pipeline step for that tool |
| Renderer | renderers/ | Which files go where for Helm or Kustomize, and how is that checked? | The proposal stops; there is no fallback layout |
| Target kind | target-kinds/ | What does a deploy look like on a target that is not Kubernetes? | The proposal stops before cloning anything; it is never authored as Kubernetes instead |
Packs ship inside the runner image today. The copies in
trustacks-policy are the public source, but a pack change reaches you in a
runner release, not on its own. Moving packs to the same signed pull as the
constitution is planned.
Framework packs
The Code Reviewer’s detection runs before any agent: a deterministic match on files in your repo, not a model guess. The matched pack goes to both the Code Reviewer and the DevOps Engineer.
| Pack | Detects | Grounds |
|---|---|---|
python_fastapi | fastapi in pyproject.toml or requirements.txt | python:3.12-slim image, ruff check and pytest |
spring_boot | Spring Boot in pom.xml, build.gradle, or build.gradle.kts | Maven build to eclipse-temurin:21-jre, mvn -B verify -Dlint=true |
dotnet | *.csproj, *.fsproj, *.vbproj, or global.json | dotnet/sdk:10.0 to dotnet/aspnet:10.0, dotnet format --verify-no-changes, dotnet test |
go | go.mod | golang:1.27 (or 1.26, from your go.mod) to distroless/static:nonroot, go vet and go test -race |
Each pack carries detection rules, a prompt addendum, a reference Dockerfile,
and a reference CI workflow. The DevOps Engineer may adapt within the shape
(entrypoint, runtime version, build arguments) but not restructure it: the
packs ship two jobs, test and build, and so does the emitted workflow,
plus any jobs you added yourself.
A project that targets a runtime the pack no longer carries (for example .NET 8 after its end of life) gets the pack’s default, and the pull request says so in a Runtime support section with the upgrade it needs.
A repo that matches no pack is still analyzed. Proposals for it are another
matter: the framework pack is also where pinned foundational actions such as
actions/checkout come from, so without one, expect the proposal to stop at
pre-emit validation. In practice, proposals today cover the four frameworks
above.
Tool-action packs
One file per tool. Each maps a tool you declare in your environment profile to its GitHub Action, pinned to a full commit SHA, with default inputs.
| Pack | Profile category |
|---|---|
trivy | image_scanning |
semgrep | sast_sca |
gitleaks | secret_scanning |
syft | sbom_signing |
cosign | sbom_signing |
codeql-upload-sarif | None. Rides along with a scanner that writes SARIF (trivy, semgrep) |
upload-artifact | None. Keeps that SARIF as a workflow artifact |
tool_name: gitleaks
profile_categories: [secret_scanning]
action: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e
action_version_label: v3.0.0
inputs: {}
permissions:
contents: read
pull-requests: read
last_verified: "2026-11-06"The DevOps Engineer may only use an action whose SHA comes from a pack. If
you declare a tool with no pack (for example snyk_container), the proposal
gets no step for it and records a TODO, rather than a guessed SHA that
would pass the pinning rule and fail at run time.
These packs are also how maturity scoring recognizes your tools running in CI. See Maturity scoring.
SHAs are reviewed on a quarterly cadence, recorded in last_verified. See
tool-actions/CURATION.md in trustacks-policy.
Token permissions
From runner 0.2.21, a tool-action pack also declares permissions: the
GITHUB_TOKEN permissions the job running its step must grant. They come
from the action’s documentation and the API calls in its source at the
pinned commit.
| Pack | The job must grant | Why |
|---|---|---|
gitleaks | contents: read, pull-requests: read | On a pull request the action lists the pull request’s commits. Without pull-requests: read it fails with a 403, Resource not accessible by integration |
codeql-upload-sarif | actions: read, contents: read, security-events: write | GitHub’s SARIF upload needs security-events: write, and actions: read in private repos |
upload-artifact | Nothing | Artifacts are written with the runner’s own token, not GITHUB_TOKEN |
TruStacks checks that the job grants them. A workflow whose tool step sits
in a job with an explicit permissions block (the job’s own, or the
workflow’s top-level one) that lacks a declared scope is refused when the
DevOps Engineer writes it, and flagged again by pre-emit validation as
step_permissions.
When TruStacks edits permissions in a workflow you already have, it follows these rules:
- Per job. A change applies to the job that runs the tool step, not to the whole workflow.
- Never removes or lowers a grant. Every scope already there keeps its level. An edit that drops or reduces one is refused.
- Never adds a block to a job that inherits. In a reusable workflow, a
job with no
permissionsof its own, and no top-levelpermissionsin the workflow, inherits the calling job’s grant. (With a top-level block, the job uses that block instead, and the rule below applies.) A block would replace that grant and silently drop every other scope it carries, such aspackages: write. So TruStacks leaves the job as it is, and the pull request tells you which permissions your calling job must grant instead. - Raises a level only to what the pack declares. A scope may be added,
or raised from
nonetoreador fromreadtowrite, only to exactly the level a pack declares for a step in that job. Nothing else changes. - Prefers a job-level block over widening the top level. When several
jobs share the workflow’s top-level
permissions, TruStacks gives the tool step’s job its own block, copying the top-level scopes and adding the pack’s, so jobs such asbuildanddeployare not widened. The top-level block is raised only when a single job uses it. - Leaves
read-allandwrite-allas written. Replacing either with a list of scopes would change every scope it covers. If a tool step needs a write underread-all, the pull request says what you must change. Apermissionsvalue GitHub doesn’t accept is also left as written and named in the pull request.
Your service repo’s calling job must grant all of this too, because a called workflow can only keep or reduce its caller’s token. See The caller’s permissions.
SARIF upload
When your profile declares a scanner with a working step that writes SARIF
(Trivy, and Semgrep from runner 0.2.23), the scan step is followed by two more, both with if: always() so a scan that
fails the build on findings still reports them:
- The code scanning upload (
codeql-upload-sarif), withcontinue-on-error: true. It never fails your build. - A workflow artifact (
upload-artifact) named<tool>-sarif. The results are always kept on the run, whatever your repo’s plan.
GitHub code scanning shows the results only on public repos, or on private and internal repos with GitHub Advanced Security (GitHub Code Security). Anywhere else the upload step fails without failing the build, and the artifact is where the results are. You can download it from the run and upload it in Signals.
gitleaks
-
License. A repo owned by a GitHub organization needs a Gitleaks license (free from gitleaks.io), stored as a repo or organization secret named
GITLEAKS_LICENSE. Without it the action exits with missing gitleaks license. A repo owned by a personal account needs none. TruStacks references the secret only when you have it; it never invents one. -
Reusable workflows only see the secrets their caller passes. Storing the license is not enough. Either the calling job sets
secrets: inherit(callers in the same organization or enterprise), or it passes the secret explicitly and the called workflow declares it underon.workflow_call.secrets:# Calling job, in the SERVICE repo jobs: trustacks: uses: <owner>/<platform-repo>/.github/workflows/ci-<service>.yaml@<commit-sha> secrets: GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}# Called workflow, in the PLATFORM repo on: workflow_call: secrets: GITLEAKS_LICENSE: required: false jobs: ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@<commit-sha> with: fetch-depth: 0 - uses: gitleaks/gitleaks-action@<commit-sha> env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}Either way, the Gitleaks step itself has to set
GITLEAKS_LICENSEin itsenv:. Passing the secret to the workflow does not put it in the action’s environment. -
Inline comments. The action also tries to comment on leaked lines in the pull request. That needs
pull-requests: write; without it the action logs a warning and carries on, and the findings still reach the job summary. Grant write only if you want the comments.
Every pin is checked against a reviewed list. From runner 0.2.19, every
GitHub Action reference in the framework and tool-action packs must be a
full commit SHA that appears in a reviewed table of action, commit and
release tag; a test in both repositories fails on anything else (a tag such
as @v3, a branch, a short SHA, or a commit nobody reviewed). Each pin was
resolved through GitHub’s API, and the actions run on Node 24: GitHub
removed Node 20 from its hosted runners on 2026-09-23. Semgrep publishes no
GitHub Action, so from runner 0.2.23 its entry is a container step:
docker://semgrep/semgrep:<version>@sha256:<digest>, pinned by the image’s
digest and checked against a reviewed table of image, digest and tag the same
way. It runs semgrep scan with Semgrep’s default ruleset (p/default),
fails the build only on ERROR-severity findings, and needs Docker on the
runner (GitHub-hosted Linux runners have it) and outbound HTTPS to
semgrep.dev for the ruleset. On Azure Pipelines it runs as a docker run
script step, because the image can’t be an Azure container job.
Pipelines that TruStacks generated before runner 0.2.19 keep their existing
pins until the next proposal for that service.
Renderer packs
One file per renderer: which files to emit, where they go, what the ArgoCD Application points at, and the command that proves they render.
| Pack | Root | ArgoCD points at | Checked with |
|---|---|---|---|
helm | gitops/{application}/{cluster}/{service} | The chart | helm template |
kustomize | gitops/{application}/{service} | overlays/{cluster} | kustomize build |
See Platform repo layout for the full trees. Renderer packs describe Kubernetes targets only. A Fargate target has no renderer, whatever the Application’s renderer setting says.
Target-kind packs
A deployment target has a kind: what a deploy physically is there. Kubernetes is described by the renderer packs above. Every other kind gets one target-kind pack, named after the kind. There is one today.
| Pack | Status | Emits per service, per target |
|---|---|---|
ecs-fargate | Beta | task-definition.json, a blank deploy-target.json, and .github/workflows/deploy-<service>-<target>.yaml |
A target-kind pack carries:
- the default root (
gitops/{application}/{cluster}/{service}for Fargate), where{cluster}is the target name and is required; - the hardened task-definition skeleton the agent adapts within;
- the binding fields, each with its purpose and the format the pre-emit check enforces;
- the deploy workflow template, which the agent copies as is;
- the deploy action, whose presence is what makes a workflow a deploy workflow to the constitution.
The actions a target kind requires (actions/checkout,
aws-actions/configure-aws-credentials,
aws-actions/amazon-ecs-deploy-task-definition) are pinned to commit SHAs
in the pack itself, not in tool-action packs: you do not choose them, the
kind does. See ECS Fargate layout.
Contributing a pack
Fork trustacks-policy, add or edit a YAML file, sign off each commit
(git commit -s), and open a pull request. CI runs the constitution tests,
checks that the packs and the constitution agree, and rejects commits without
a sign-off. Until
packs move to the signed pull, an accepted pack also needs a runner release
before it reaches you.
Where to go next
- Environment profile · declare the tools packs map
- Proposal lifecycle · where packs are enforced
- Constitution · the rules the packs are written to pass