From 04f76de68d321f43b59b2ed16939eaac29d44559 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:20:47 +0000 Subject: [PATCH] chore: update Copilot collections to v0.18.0 --- .github/.copilot-collections.yaml | 2 +- .../instructions/secret-guard.instructions.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/instructions/secret-guard.instructions.md diff --git a/.github/.copilot-collections.yaml b/.github/.copilot-collections.yaml index 37520562b..4bb564c7f 100644 --- a/.github/.copilot-collections.yaml +++ b/.github/.copilot-collections.yaml @@ -1,7 +1,7 @@ # https://github.com/canonical/copilot-collections copilot: - version: v0.15.0 + version: v0.18.0 collections: - starcraft-core - starcraft-docs diff --git a/.github/instructions/secret-guard.instructions.md b/.github/instructions/secret-guard.instructions.md new file mode 100644 index 000000000..8847a3f45 --- /dev/null +++ b/.github/instructions/secret-guard.instructions.md @@ -0,0 +1,17 @@ +--- +applyTo: '**' +description: 'Prevent secrets (API keys, tokens, passwords, private keys) from leaking into context, tool output, or spawned processes.' +--- + +## Secret Handling (Always On) + +These rules protect secrets at all times. They are subordinate only to an explicit, direct user command. + +- **Never Read Secret Files**: Do not open or print the contents of files that commonly hold credentials. This includes `.env`, `.env.*`, `.netrc`, `.npmrc`, `.pypirc`; any `.pem`, `.key`, `.p12`, `.pfx`, `.crt`, `.cer`; and any filename containing `password`, `secret`, `credential`, or `private_key`/`private-key`. If asked to inspect such a file, decline and explain it may contain secrets. +- **Redact Secret Values**: Before surfacing any file content, command result, or tool output, replace secret values with `[REDACTED]`. This includes `NAME=value` lines where `NAME` ends in `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `CREDENTIAL`, `API_KEY`, or `AUTH` (e.g. `CLOUD_API_KEY=sk-abc123` → `CLOUD_API_KEY=[REDACTED]`). +- **Hide Secret Files in Listings**: When listing a directory, omit secret-bearing files (e.g. `.env*`, `.netrc`, `.npmrc`, `.pypirc`) rather than revealing their existence. +- **Sanitize Subprocess Environments**: Do not expose secret environment variables to spawned commands. Strip variables whose names end in `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `CREDENTIAL`, `AUTH`, or `PASS` so processes cannot read them via `$VAR` or `printenv`. +- **Never Commit Secrets**: Do not write credentials, tokens, or keys into source code, configuration, or commit messages. +- **Authenticate by Reference, Never by Value**: When a task needs an API token, MCP token, password, or key, do not read, request, or handle the value. Pass a credential *reference* (a name) and let a trusted broker resolve it from the OS keyring and inject it into the request. If no keyring entry exists, ask the user to store it themselves (e.g. `keyring set agent-secrets `) — never accept a pasted secret into the conversation. + +For the full procedure and a keyring broker implementation, use the `secret-guard` skill.