Skip to content

[WISE] No secrets in files: gitignore, CI check, AGENTS.md rule - #2100

Merged
swu-wise[bot] merged 7 commits into
mainfrom
wise/no-env-files
Nov 28, 2026
Merged

swu-wise[bot] merged 7 commits into
mainfrom
wise/no-env-files

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Enforces no secrets in files so all secrets live only in Infisical. Updates .gitignore, adds a No env files CI check, and documents the rule in AGENTS.md.

Changes

  • Updated .gitignore to block .env, .env.*, *.env, .dev.vars, .prod.vars, *.vars variants, while allowing *.example, *.sample, *.template and .cursor/infisical.env.
  • Added .github/workflows/no-env-files.yml to fail pull requests and main pushes when a tracked env or vars file is present, with exclusions for example/sample/template/dist and an allowlist for .cursor/infisical.env.
  • Added No secrets in files guidance to AGENTS.md requiring runtime reads from Infisical, prohibiting secrets in tracked or untracked files, and directing immediate deletion and rotation if a secret file is committed.

Operational impact

Contributors can no longer commit env or vars files with real values. Only placeholder example, sample, or template files may be committed. Violations are blocked locally by ignore rules and in CI by the new workflow.

Verification and risks

No test execution evidence is provided in the changes. CI behavior is unverified in this summary. Automated review reported 2 unresolved medium findings: the CI pattern may miss suffixed .env / .vars files, and AGENTS.md does not document the .cursor/infisical.env exception that ignore and CI enforce.


Summary

Updates the No secrets in files rule in AGENTS.md to revise handling of a committed secret file. It now directs immediate removal from the tree and keeping a backup on own systems (never in the repo or in chat), with history purge as a separate owner decision.

Risk

Automated review reports one high finding that this revision drops mandatory rotation of every value in a committed secret file. This remains unverified and unresolved in the provided changes. No test evidence, issue references, or runtime verification is reported.


Summary

This PR strengthens the CI guard enforcing the rule that no secrets are stored in files and all secrets live only in Infisical. The provided diff modifies .github/workflows/no-env-files.yml only.

Changes

  • Broadened the tracked-file check so files with a suffix after .vars (e.g. vars.local, vars.staging) are now rejected, mirroring the existing .env.* handling; previously only files ending exactly in .vars were caught.
  • Added a timeout-minutes: 10 cap to the "No env files" job.

Operational impact

  • The check now fails CI with an error listing any tracked env/vars file outside the exclusions, instead of allowing suffixed *.vars.* files to slip through. Existing exclusions remain: *.example, *.sample, *.template, *.dist variants and the allowlisted .cursor/infisical.env.

Unresolved review findings (high)

  • *.dist env files bypass the tracked-secrets check via the exclusion regex.
  • The case-sensitive grep lets uppercase env file names bypass the check.

Tests

No tests were added, and no test runs were reported in the provided changes; the behavior of the updated pattern is unverified.

Note

The PR title also references gitignore entries and an AGENTS.md rule, but those files are not included in the provided diff, so their contents cannot be summarized here.


Purpose

Enforce no secrets in tracked files, with secrets living only in Infisical. Automated code review reported no issues.

Changes

  • Updated .gitignore to also ignore *.vars.*, *.env.*, and .envrc.
  • Tightened CI detection of tracked env/vars files and narrowed example/sample/template exclusions.
  • Added CI validation that .cursor/infisical.env holds only INFISICAL_* coordinates and no credential-looking keys.

Impact

CI will now fail if an env/vars file is tracked or if the Infisical coordinates file contains non-coordinate or credential-like entries. Operational runtime verification was not provided in the changes.


Summary

Tightens no-secrets-in-files guardrails so all secrets live only in Infisical. Documents .cursor/infisical.env as the sole coordinates-only exception and enforces it in CI.

Changes

  • .gitignore: now also ignores *.vars.*, *.env.*, and .envrc while still allowing *.example, *.sample, and *.template placeholders.
  • .github/workflows/no-env-files.yml: broadens tracked-file detection to cover .envrc and dotted *.env / *.vars variants and adds a content check limiting .cursor/infisical.env to INFISICAL_PROJECT_ID, INFISICAL_ENV, and INFISICAL_DOMAIN.
  • AGENTS.md: clarifies that .cursor/infisical.env may hold only those three coordinates and never a credential, with CI checking its content.

Operational impact

PRs tracking env/vars/envrc files will fail the No env files check. No runtime behavior change; verification status is unverified with no test evidence in the diff.

Unresolved risks / Review findings

  • High: content check strips comments/blank lines before validation, so secrets could hide in infisical.env.
  • Medium: .gitignore still misses .envrc.local and *.envrc variants.

Summary

This PR tightens the no-secrets-in-files guardrails so real env/vars files cannot be tracked in git. All secrets remain only in Infisical.

Changes

  • Expanded .gitignore to also ignore *.envrc and *.envrc.* alongside existing env/vars patterns, while explicitly keeping *.example, *.sample, and *.template files unignored.
  • Updated CI check no-env-files.yml to detect tracked env/vars/envrc files case-insensitively and with directory-aware matching.
  • Hardened the tracked-file content check to only allow INFISICAL_PROJECT_ID, INFISICAL_ENV, and INFISICAL_DOMAIN, with safer handling of filenames.

Impact and verification

Operational impact is reduced risk of accidental secret commit and CI failure if a disallowed env file is tracked. No test evidence is provided in the supplied changes and runtime behavior is unverified. Automated code review reported no issues.

@swu-wise

swu-wise Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

@kody-ai

This comment has been minimized.

Comment thread .github/workflows/no-env-files.yml Resolved
Comment thread .github/workflows/no-env-files.yml Resolved
Comment thread AGENTS.md Resolved
@kody-ai

kody-ai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

Risk was identified in this PR.

@swu-wise

swu-wise Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@kody start-review (head 51d048a, rule wording updated)

@kody-ai

This comment has been minimized.

Comment thread AGENTS.md Resolved
@kody-ai

This comment has been minimized.

Comment thread .github/workflows/no-env-files.yml Resolved
Comment thread .github/workflows/no-env-files.yml Resolved
@kody-ai

This comment has been minimized.

@swu-wise

swu-wise Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@kody start-review (head 3fdda21, check v2 and ignore patterns)

Comment thread .github/workflows/no-env-files.yml Resolved
Comment thread .github/workflows/no-env-files.yml Resolved
@kody-ai

This comment has been minimized.

@swu-wise

swu-wise Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@kody start-review (head f39660e)

@kody-ai

This comment has been minimized.

Comment thread .github/workflows/no-env-files.yml Resolved
Comment thread .gitignore Resolved
@swu-wise

swu-wise Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@kody start-review (head 0b1f350)

@kody-ai

kody-ai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@swu-wise
swu-wise Bot merged commit b29efbd into main Nov 28, 2026
26 checks passed
@swu-wise
swu-wise Bot deleted the wise/no-env-files branch November 28, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant