@agenttrail/guardrails 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2658,6 +2658,8 @@ var requireAuthOnPiiEndpoints = {
2658
2658
  };
2659
2659
 
2660
2660
  // src/packs/secret-exposure/se-credential-file.ts
2661
+ var NOT_VENDORED = "*(@(!(node_modules|dist|vendor)|@(node_modules|dist|vendor)[^/]*)/)";
2662
+ var PROD_CONFIG = "@(yml|yaml|json|toml|env|ini|conf|properties|tf|tfvars)";
2661
2663
  var seCredentialFile = {
2662
2664
  id: "se.credential-file",
2663
2665
  category: "secret-exposure",
@@ -2665,7 +2667,7 @@ var seCredentialFile = {
2665
2667
  defaultAction: "require_approval",
2666
2668
  owasp: ["ASI02", "ASI03", "LLM02"],
2667
2669
  title: "Opening a file that holds credentials",
2668
- description: "Holds a file tool opening a path where credentials live \u2014 an SSH private key, an AWS credentials file, a PEM/P12/PFX/JKS keystore, `.npmrc` or `.pypirc` (which hold registry tokens), a Docker config, or a kubeconfig. Public keys are excluded (`*.pub`). It matches the PATH ONLY: it cannot tell whether the file actually holds a secret, so a `.pem` that is a public certificate is held too, and a credential in a file named something else is missed entirely. `.env` files are covered separately by block-env-file-read.",
2670
+ description: "Holds a file tool opening a path where credentials live \u2014 an SSH private key, an AWS credentials file, a PEM/P12/PFX/JKS keystore, `.npmrc` or `.pypirc` (which hold registry tokens), a Docker config, or a kubeconfig. Public keys are excluded (`*.pub`). It matches the PATH ONLY: it cannot tell whether the file actually holds a secret, so a `.pem` that is a public certificate is held too, and a credential in a file named something else is missed entirely. `.env` files are covered separately by block-env-file-read. It also holds READING \u2014 the `Read` and `Grep` tools, nothing else \u2014 of files whose edit another guardrail already holds and which commonly carry a secret: `/etc/shadow`, `/etc/gshadow`, their `-` backups, `/etc/sudoers` and `/etc/sudoers.d/`; SSH host private keys (`/etc/ssh/ssh_host_*_key` and the legacy `/etc/ssh/ssh_host_key`); `/etc/ssl/private/` and `/etc/pki/tls/private/`; Kubernetes admin configs (`/etc/kubernetes/*.conf`) and private keys (`/etc/kubernetes/pki/**/*.key`); the k3s kubeconfig (`/etc/rancher/k3s/k3s.yaml`); a repository's `.git/config`, where a remote URL or extra header can carry a token; agent configuration that often holds API keys \u2014 `.mcp.json`, `.claude/settings.local.json`, `.claude.json`, `.cursor/mcp.json` and `.codex/config.toml`; and production configuration: a `.yml`, `.yaml`, `.json`, `.toml`, `.env`, `.ini`, `.conf`, `.properties`, `.tf` or `.tfvars` file named `*.prod.*`, `prod.*`, `*.production.*` or `production.*`, or under a `prod/` or `production/` folder, unless any folder in the path, an absolute path's leading folders included, is named exactly `node_modules`, `dist` or `vendor` (so `/srv/vendor/app/config/database.prod.yml` is not held). A Grep anywhere under `/etc`, including a search of the folder itself or with a wildcard, is held too; a Read of an `/etc` file not named here is not. Editing those files is held by the guardrail that owns the path, not by this one. NOT held on read by this guardrail: a shell command such as `cat`, on any agent (Codex has no read tool, so its reads are always shell commands); a file tool other than Read and Grep, such as Claude Code's Glob or another Cursor tool, which the guardrail that owns the path still holds under its own title, except on `.claude.json`, which no other guardrail names; `.claude/settings.json`, at project or user level; other secrets under `/etc` such as Kerberos keytabs and VPN or Wi-Fi connection files, which are held on Grep only; a Grep of a production folder with no file pattern, or with a pattern whose extension is a wildcard; production files of other types, such as `.key`, `.tfstate`, `.hcl`, `.cfg`, `.xml`, `.config` or Angular's `environment.prod.ts`; and production code or prose, such as `webpack.prod.js` or a runbook in `docs/production/`.",
2669
2671
  match: {
2670
2672
  any_of: [
2671
2673
  { kind: "execute_tool", file_glob: "**/.ssh/id_*" },
@@ -2677,7 +2679,63 @@ var seCredentialFile = {
2677
2679
  { kind: "execute_tool", file_glob: "**/.npmrc" },
2678
2680
  { kind: "execute_tool", file_glob: "**/.pypirc" },
2679
2681
  { kind: "execute_tool", file_glob: "**/.docker/config.json" },
2680
- { kind: "execute_tool", file_glob: "**/.kube/config" }
2682
+ { kind: "execute_tool", file_glob: "**/.kube/config" },
2683
+ // Read only (see the header): system account and privilege files, host and TLS keys,
2684
+ // cluster admin configs and keys.
2685
+ {
2686
+ kind: "execute_tool",
2687
+ label: "{Read,Grep}",
2688
+ file_glob: "/etc/{shadow,shadow-,gshadow,gshadow-,sudoers}"
2689
+ },
2690
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/sudoers.d/**" },
2691
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssh/ssh_host_*_key" },
2692
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssh/ssh_host_key" },
2693
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssl/private/**" },
2694
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/pki/tls/private/**" },
2695
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/kubernetes/*.conf" },
2696
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/kubernetes/pki/**/*.key" },
2697
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/rancher/k3s/k3s.yaml" },
2698
+ // Grep only: a search anywhere under `/etc`, including the folder itself.
2699
+ { kind: "execute_tool", label: "Grep", file_glob: "/etc/**" },
2700
+ // Read only: a remote URL or `http.extraheader` can carry a token.
2701
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.git/config" },
2702
+ // Read only: MCP server definitions and agent settings often carry API keys in `env`.
2703
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.mcp.json" },
2704
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.claude/settings.local.json" },
2705
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.claude.json" },
2706
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.cursor/mcp.json" },
2707
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.codex/config.toml" },
2708
+ // Read only: production configuration and secret files (see the header).
2709
+ {
2710
+ kind: "execute_tool",
2711
+ label: "{Read,Grep}",
2712
+ file_glob: `${NOT_VENDORED}*.prod.?(*.)${PROD_CONFIG}`
2713
+ },
2714
+ {
2715
+ kind: "execute_tool",
2716
+ label: "{Read,Grep}",
2717
+ file_glob: `${NOT_VENDORED}prod.?(*.)${PROD_CONFIG}`
2718
+ },
2719
+ {
2720
+ kind: "execute_tool",
2721
+ label: "{Read,Grep}",
2722
+ file_glob: `${NOT_VENDORED}*.production.?(*.)${PROD_CONFIG}`
2723
+ },
2724
+ {
2725
+ kind: "execute_tool",
2726
+ label: "{Read,Grep}",
2727
+ file_glob: `${NOT_VENDORED}production.?(*.)${PROD_CONFIG}`
2728
+ },
2729
+ {
2730
+ kind: "execute_tool",
2731
+ label: "{Read,Grep}",
2732
+ file_glob: `${NOT_VENDORED}prod/${NOT_VENDORED}*.${PROD_CONFIG}`
2733
+ },
2734
+ {
2735
+ kind: "execute_tool",
2736
+ label: "{Read,Grep}",
2737
+ file_glob: `${NOT_VENDORED}production/${NOT_VENDORED}*.${PROD_CONFIG}`
2738
+ }
2681
2739
  ],
2682
2740
  none_of: [{ kind: "execute_tool", file_glob: "**/*.pub" }]
2683
2741
  },
@@ -2686,13 +2744,154 @@ var seCredentialFile = {
2686
2744
  file("/home/dev/.ssh/id_rsa", "Read"),
2687
2745
  file("/Users/dev/.aws/credentials", "Read"),
2688
2746
  file("certs/server.pem", "Read"),
2689
- file(".npmrc", "Write")
2747
+ file(".npmrc", "Write"),
2748
+ // The other arms hold every tool, under a production or vendored path too: the
2749
+ // production arms' limits do not reach them.
2750
+ file("/home/prod/.ssh/id_rsa.txt", "Edit"),
2751
+ file("/home/prod/.ssh/id_rsa.txt", "Read"),
2752
+ file("/srv/production/.ssh/id_ed25519.md", "Write"),
2753
+ file("vendor/certs/server.pem", "Read"),
2754
+ // The original arms, each with a path only that arm matches.
2755
+ file("/home/dev/keys/id_rsa", "Read"),
2756
+ file("backup/id_ed25519", "Write"),
2757
+ file("certs/client.p12", "Read"),
2758
+ file("android/app/release.jks", "Edit"),
2759
+ file("/home/dev/.pypirc", "Read"),
2760
+ file("/home/dev/.docker/config.json", "Read"),
2761
+ file("/home/dev/.kube/config", "Grep"),
2762
+ // Each read-only arm, once through Read and once through Grep.
2763
+ file("/etc/shadow", "Read"),
2764
+ file("/etc/gshadow", "Grep"),
2765
+ file("/etc/sudoers", "Read"),
2766
+ file("/etc/shadow-", "Read"),
2767
+ file("/etc/gshadow-", "Read"),
2768
+ file("/etc/sudoers.d/90-cloud-init-users", "Read"),
2769
+ file("/etc/sudoers.d/admins", "Grep"),
2770
+ file("/etc/ssh/ssh_host_ed25519_key", "Read"),
2771
+ file("/etc/ssh/ssh_host_rsa_key", "Grep"),
2772
+ file("/etc/ssh/ssh_host_key", "Read"),
2773
+ file("/etc/ssh/ssh_host_key", "Grep"),
2774
+ file("/etc/ssl/private/server.key", "Read"),
2775
+ file("/etc/ssl/private/ca.key", "Grep"),
2776
+ file("/etc/pki/tls/private/server.key", "Read"),
2777
+ file("/etc/pki/tls/private/localhost.key", "Grep"),
2778
+ file("/etc/kubernetes/admin.conf", "Read"),
2779
+ file("/etc/kubernetes/controller-manager.conf", "Grep"),
2780
+ file("/etc/kubernetes/pki/ca.key", "Read"),
2781
+ file("/etc/kubernetes/pki/etcd/ca.key", "Grep"),
2782
+ file("/etc/rancher/k3s/k3s.yaml", "Read"),
2783
+ file("/etc/rancher/k3s/k3s.yaml", "Grep"),
2784
+ // The Grep-only arm: a folder, a wildcard joined to a folder, and the root of `/etc`.
2785
+ file("/etc", "Grep"),
2786
+ file("/etc/ssh", "Grep"),
2787
+ file("/etc/kubernetes", "Grep"),
2788
+ file("/etc/ssh/*_key", "Grep"),
2789
+ file("/etc/shadow*", "Grep"),
2790
+ file("/etc/hosts", "Grep"),
2791
+ file("/repo/.git/config", "Read"),
2792
+ file("/repo/.git/config", "Grep"),
2793
+ file(".mcp.json", "Read"),
2794
+ file(".mcp.json", "Grep"),
2795
+ file("/repo/.claude/settings.local.json", "Read"),
2796
+ file("/repo/.claude/settings.local.json", "Grep"),
2797
+ file("/Users/dev/.claude.json", "Read"),
2798
+ file("/Users/dev/.claude.json", "Grep"),
2799
+ file("/repo/.cursor/mcp.json", "Read"),
2800
+ file("/Users/dev/.cursor/mcp.json", "Grep"),
2801
+ file("/Users/dev/.codex/config.toml", "Read"),
2802
+ file("/Users/dev/.codex/config.toml", "Grep"),
2803
+ file("config/database.prod.yml", "Read"),
2804
+ file("docker-compose.prod.yml", "Grep"),
2805
+ file("config/prod.json", "Read"),
2806
+ file("config/prod.env", "Grep"),
2807
+ file("config/app.production.json", "Read"),
2808
+ file("config/app.production.toml", "Grep"),
2809
+ file("config/production.yaml", "Read"),
2810
+ file("config/production.env", "Grep"),
2811
+ file("deploy/prod/values.yaml", "Read"),
2812
+ file("infra/envs/prod/main.tfvars", "Grep"),
2813
+ file("deploy/prod/app.properties", "Read"),
2814
+ file("k8s/production/secrets.yaml", "Read"),
2815
+ file("k8s/production/configmap.yml", "Grep"),
2816
+ // Folders that only start with a skipped name are still held.
2817
+ file("distribution/prod.json", "Read"),
2818
+ file("vendors/config/production.yml", "Grep"),
2819
+ // One fixture per file type not used above.
2820
+ file("infra/prod/main.tf", "Read"),
2821
+ file("config/nginx.prod.conf", "Read"),
2822
+ file("config/app.prod.ini", "Grep")
2690
2823
  ],
2691
2824
  allow: [
2692
2825
  file("/home/dev/.ssh/id_rsa.pub", "Read"),
2693
2826
  file("certs/server.crt", "Read"),
2694
2827
  file("src/index.ts"),
2695
- file("package.json")
2828
+ file("package.json"),
2829
+ // Near-misses of the read-only arms.
2830
+ file("/etc/passwd", "Read"),
2831
+ file("/etc/passwd-", "Read"),
2832
+ file("/etc/group", "Read"),
2833
+ file("/etc/hosts", "Read"),
2834
+ file("/etc/sudo.conf", "Read"),
2835
+ file("/etc/ssh/ssh_host_ed25519_key.pub", "Read"),
2836
+ file("/etc/ssh/ssh_host_key.pub", "Read"),
2837
+ file("/etc/ssh/sshd_config", "Read"),
2838
+ file("/etc/ssl/certs/ca-certificates.crt", "Read"),
2839
+ file("/etc/pki/tls/certs/server.crt", "Read"),
2840
+ file("/etc/kubernetes/manifests/kube-apiserver.yaml", "Read"),
2841
+ file("/etc/kubernetes/pki/ca.crt", "Read"),
2842
+ file("/etc/rancher/k3s/config.yaml", "Read"),
2843
+ file("/opt/etc/app.conf", "Grep"),
2844
+ file("/repo/.git/HEAD", "Read"),
2845
+ file("/repo/.gitconfig.example", "Read"),
2846
+ file("mcp.json.example", "Read"),
2847
+ file("/repo/.claude/settings.json", "Read"),
2848
+ file("/repo/claude.json", "Read"),
2849
+ file("/repo/.cursor/rules/style.mdc", "Read"),
2850
+ file("/repo/codex/config.toml", "Read"),
2851
+ file("config/database.staging.yml", "Read"),
2852
+ // Production code, prose and vendored files are not production configuration.
2853
+ file("node_modules/react/cjs/react.production.min.js", "Read"),
2854
+ file("node_modules/react-router/dist/production/index.d.ts", "Grep"),
2855
+ // One vendored configuration file per production arm.
2856
+ file("node_modules/some-lib/config/app.prod.json", "Read"),
2857
+ file("dist/prod.json", "Read"),
2858
+ file("node_modules/some-lib/config/app.production.json", "Grep"),
2859
+ file("vendor/config/production.yml", "Read"),
2860
+ file("dist/prod/app.json", "Read"),
2861
+ file("vendor/production/config.yml", "Grep"),
2862
+ file("src/Settings.prod.test.tsx", "Read"),
2863
+ file("infra/bin/prod.ts", "Read"),
2864
+ file("webpack.prod.js", "Grep"),
2865
+ file("config/database.prod.md", "Read"),
2866
+ file("config/prod.md", "Read"),
2867
+ file("config/app.production.mdx", "Read"),
2868
+ file("config/production.txt", "Read"),
2869
+ file("deploy/prod/RUNBOOK.txt", "Grep"),
2870
+ file("docs/production/README.md", "Read"),
2871
+ // The read-only arms do not hold an edit: the guardrail that owns each path does.
2872
+ file("/etc/shadow", "Edit"),
2873
+ file("/etc/shadow-", "Write"),
2874
+ file("/etc/sudoers.d/admins", "Write"),
2875
+ file("/etc/ssh/ssh_host_ed25519_key", "Write"),
2876
+ file("/etc/ssh/ssh_host_key", "Edit"),
2877
+ file("/etc/ssl/private/server.key", "Edit"),
2878
+ file("/etc/pki/tls/private/server.key", "Write"),
2879
+ file("/etc/kubernetes/admin.conf", "Write"),
2880
+ file("/etc/kubernetes/pki/sa.key", "Write"),
2881
+ file("/etc/rancher/k3s/k3s.yaml", "Edit"),
2882
+ file("/etc/hosts", "Edit"),
2883
+ file("/repo/.git/config", "Edit"),
2884
+ file(".mcp.json", "Edit"),
2885
+ file("/repo/.claude/settings.local.json", "Write"),
2886
+ file("/Users/dev/.claude.json", "Write"),
2887
+ file("/repo/.cursor/mcp.json", "Edit"),
2888
+ file("/Users/dev/.codex/config.toml", "Edit"),
2889
+ file("config/database.prod.yml", "Edit"),
2890
+ file("config/prod.json", "Write"),
2891
+ file("config/app.production.json", "Edit"),
2892
+ file("config/production.yaml", "Write"),
2893
+ file("deploy/prod/values.yaml", "Edit"),
2894
+ file("k8s/production/secrets.yaml", "Write")
2696
2895
  ]
2697
2896
  }
2698
2897
  };
@@ -3843,8 +4042,8 @@ function owaspTitle(id) {
3843
4042
  }
3844
4043
 
3845
4044
  // src/stamp.ts
3846
- var CATALOG_VERSION = "0.2.4";
3847
- var CATALOG_PUBLISHED_AT = "2026-10-16T16:15:37Z";
4045
+ var CATALOG_VERSION = "0.2.6";
4046
+ var CATALOG_PUBLISHED_AT = "2026-10-22T16:18:01Z";
3848
4047
 
3849
4048
  // src/rules.ts
3850
4049
  var RULES_BY_PACK = {