@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.
@@ -2602,6 +2602,8 @@ var requireAuthOnPiiEndpoints = {
2602
2602
  };
2603
2603
 
2604
2604
  // src/packs/secret-exposure/se-credential-file.ts
2605
+ var NOT_VENDORED = "*(@(!(node_modules|dist|vendor)|@(node_modules|dist|vendor)[^/]*)/)";
2606
+ var PROD_CONFIG = "@(yml|yaml|json|toml|env|ini|conf|properties|tf|tfvars)";
2605
2607
  var seCredentialFile = {
2606
2608
  id: "se.credential-file",
2607
2609
  category: "secret-exposure",
@@ -2609,7 +2611,7 @@ var seCredentialFile = {
2609
2611
  defaultAction: "require_approval",
2610
2612
  owasp: ["ASI02", "ASI03", "LLM02"],
2611
2613
  title: "Opening a file that holds credentials",
2612
- 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.",
2614
+ 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/`.",
2613
2615
  match: {
2614
2616
  any_of: [
2615
2617
  { kind: "execute_tool", file_glob: "**/.ssh/id_*" },
@@ -2621,7 +2623,63 @@ var seCredentialFile = {
2621
2623
  { kind: "execute_tool", file_glob: "**/.npmrc" },
2622
2624
  { kind: "execute_tool", file_glob: "**/.pypirc" },
2623
2625
  { kind: "execute_tool", file_glob: "**/.docker/config.json" },
2624
- { kind: "execute_tool", file_glob: "**/.kube/config" }
2626
+ { kind: "execute_tool", file_glob: "**/.kube/config" },
2627
+ // Read only (see the header): system account and privilege files, host and TLS keys,
2628
+ // cluster admin configs and keys.
2629
+ {
2630
+ kind: "execute_tool",
2631
+ label: "{Read,Grep}",
2632
+ file_glob: "/etc/{shadow,shadow-,gshadow,gshadow-,sudoers}"
2633
+ },
2634
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/sudoers.d/**" },
2635
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssh/ssh_host_*_key" },
2636
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssh/ssh_host_key" },
2637
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/ssl/private/**" },
2638
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/pki/tls/private/**" },
2639
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/kubernetes/*.conf" },
2640
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/kubernetes/pki/**/*.key" },
2641
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "/etc/rancher/k3s/k3s.yaml" },
2642
+ // Grep only: a search anywhere under `/etc`, including the folder itself.
2643
+ { kind: "execute_tool", label: "Grep", file_glob: "/etc/**" },
2644
+ // Read only: a remote URL or `http.extraheader` can carry a token.
2645
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.git/config" },
2646
+ // Read only: MCP server definitions and agent settings often carry API keys in `env`.
2647
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.mcp.json" },
2648
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.claude/settings.local.json" },
2649
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.claude.json" },
2650
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.cursor/mcp.json" },
2651
+ { kind: "execute_tool", label: "{Read,Grep}", file_glob: "**/.codex/config.toml" },
2652
+ // Read only: production configuration and secret files (see the header).
2653
+ {
2654
+ kind: "execute_tool",
2655
+ label: "{Read,Grep}",
2656
+ file_glob: `${NOT_VENDORED}*.prod.?(*.)${PROD_CONFIG}`
2657
+ },
2658
+ {
2659
+ kind: "execute_tool",
2660
+ label: "{Read,Grep}",
2661
+ file_glob: `${NOT_VENDORED}prod.?(*.)${PROD_CONFIG}`
2662
+ },
2663
+ {
2664
+ kind: "execute_tool",
2665
+ label: "{Read,Grep}",
2666
+ file_glob: `${NOT_VENDORED}*.production.?(*.)${PROD_CONFIG}`
2667
+ },
2668
+ {
2669
+ kind: "execute_tool",
2670
+ label: "{Read,Grep}",
2671
+ file_glob: `${NOT_VENDORED}production.?(*.)${PROD_CONFIG}`
2672
+ },
2673
+ {
2674
+ kind: "execute_tool",
2675
+ label: "{Read,Grep}",
2676
+ file_glob: `${NOT_VENDORED}prod/${NOT_VENDORED}*.${PROD_CONFIG}`
2677
+ },
2678
+ {
2679
+ kind: "execute_tool",
2680
+ label: "{Read,Grep}",
2681
+ file_glob: `${NOT_VENDORED}production/${NOT_VENDORED}*.${PROD_CONFIG}`
2682
+ }
2625
2683
  ],
2626
2684
  none_of: [{ kind: "execute_tool", file_glob: "**/*.pub" }]
2627
2685
  },
@@ -2630,13 +2688,154 @@ var seCredentialFile = {
2630
2688
  file("/home/dev/.ssh/id_rsa", "Read"),
2631
2689
  file("/Users/dev/.aws/credentials", "Read"),
2632
2690
  file("certs/server.pem", "Read"),
2633
- file(".npmrc", "Write")
2691
+ file(".npmrc", "Write"),
2692
+ // The other arms hold every tool, under a production or vendored path too: the
2693
+ // production arms' limits do not reach them.
2694
+ file("/home/prod/.ssh/id_rsa.txt", "Edit"),
2695
+ file("/home/prod/.ssh/id_rsa.txt", "Read"),
2696
+ file("/srv/production/.ssh/id_ed25519.md", "Write"),
2697
+ file("vendor/certs/server.pem", "Read"),
2698
+ // The original arms, each with a path only that arm matches.
2699
+ file("/home/dev/keys/id_rsa", "Read"),
2700
+ file("backup/id_ed25519", "Write"),
2701
+ file("certs/client.p12", "Read"),
2702
+ file("android/app/release.jks", "Edit"),
2703
+ file("/home/dev/.pypirc", "Read"),
2704
+ file("/home/dev/.docker/config.json", "Read"),
2705
+ file("/home/dev/.kube/config", "Grep"),
2706
+ // Each read-only arm, once through Read and once through Grep.
2707
+ file("/etc/shadow", "Read"),
2708
+ file("/etc/gshadow", "Grep"),
2709
+ file("/etc/sudoers", "Read"),
2710
+ file("/etc/shadow-", "Read"),
2711
+ file("/etc/gshadow-", "Read"),
2712
+ file("/etc/sudoers.d/90-cloud-init-users", "Read"),
2713
+ file("/etc/sudoers.d/admins", "Grep"),
2714
+ file("/etc/ssh/ssh_host_ed25519_key", "Read"),
2715
+ file("/etc/ssh/ssh_host_rsa_key", "Grep"),
2716
+ file("/etc/ssh/ssh_host_key", "Read"),
2717
+ file("/etc/ssh/ssh_host_key", "Grep"),
2718
+ file("/etc/ssl/private/server.key", "Read"),
2719
+ file("/etc/ssl/private/ca.key", "Grep"),
2720
+ file("/etc/pki/tls/private/server.key", "Read"),
2721
+ file("/etc/pki/tls/private/localhost.key", "Grep"),
2722
+ file("/etc/kubernetes/admin.conf", "Read"),
2723
+ file("/etc/kubernetes/controller-manager.conf", "Grep"),
2724
+ file("/etc/kubernetes/pki/ca.key", "Read"),
2725
+ file("/etc/kubernetes/pki/etcd/ca.key", "Grep"),
2726
+ file("/etc/rancher/k3s/k3s.yaml", "Read"),
2727
+ file("/etc/rancher/k3s/k3s.yaml", "Grep"),
2728
+ // The Grep-only arm: a folder, a wildcard joined to a folder, and the root of `/etc`.
2729
+ file("/etc", "Grep"),
2730
+ file("/etc/ssh", "Grep"),
2731
+ file("/etc/kubernetes", "Grep"),
2732
+ file("/etc/ssh/*_key", "Grep"),
2733
+ file("/etc/shadow*", "Grep"),
2734
+ file("/etc/hosts", "Grep"),
2735
+ file("/repo/.git/config", "Read"),
2736
+ file("/repo/.git/config", "Grep"),
2737
+ file(".mcp.json", "Read"),
2738
+ file(".mcp.json", "Grep"),
2739
+ file("/repo/.claude/settings.local.json", "Read"),
2740
+ file("/repo/.claude/settings.local.json", "Grep"),
2741
+ file("/Users/dev/.claude.json", "Read"),
2742
+ file("/Users/dev/.claude.json", "Grep"),
2743
+ file("/repo/.cursor/mcp.json", "Read"),
2744
+ file("/Users/dev/.cursor/mcp.json", "Grep"),
2745
+ file("/Users/dev/.codex/config.toml", "Read"),
2746
+ file("/Users/dev/.codex/config.toml", "Grep"),
2747
+ file("config/database.prod.yml", "Read"),
2748
+ file("docker-compose.prod.yml", "Grep"),
2749
+ file("config/prod.json", "Read"),
2750
+ file("config/prod.env", "Grep"),
2751
+ file("config/app.production.json", "Read"),
2752
+ file("config/app.production.toml", "Grep"),
2753
+ file("config/production.yaml", "Read"),
2754
+ file("config/production.env", "Grep"),
2755
+ file("deploy/prod/values.yaml", "Read"),
2756
+ file("infra/envs/prod/main.tfvars", "Grep"),
2757
+ file("deploy/prod/app.properties", "Read"),
2758
+ file("k8s/production/secrets.yaml", "Read"),
2759
+ file("k8s/production/configmap.yml", "Grep"),
2760
+ // Folders that only start with a skipped name are still held.
2761
+ file("distribution/prod.json", "Read"),
2762
+ file("vendors/config/production.yml", "Grep"),
2763
+ // One fixture per file type not used above.
2764
+ file("infra/prod/main.tf", "Read"),
2765
+ file("config/nginx.prod.conf", "Read"),
2766
+ file("config/app.prod.ini", "Grep")
2634
2767
  ],
2635
2768
  allow: [
2636
2769
  file("/home/dev/.ssh/id_rsa.pub", "Read"),
2637
2770
  file("certs/server.crt", "Read"),
2638
2771
  file("src/index.ts"),
2639
- file("package.json")
2772
+ file("package.json"),
2773
+ // Near-misses of the read-only arms.
2774
+ file("/etc/passwd", "Read"),
2775
+ file("/etc/passwd-", "Read"),
2776
+ file("/etc/group", "Read"),
2777
+ file("/etc/hosts", "Read"),
2778
+ file("/etc/sudo.conf", "Read"),
2779
+ file("/etc/ssh/ssh_host_ed25519_key.pub", "Read"),
2780
+ file("/etc/ssh/ssh_host_key.pub", "Read"),
2781
+ file("/etc/ssh/sshd_config", "Read"),
2782
+ file("/etc/ssl/certs/ca-certificates.crt", "Read"),
2783
+ file("/etc/pki/tls/certs/server.crt", "Read"),
2784
+ file("/etc/kubernetes/manifests/kube-apiserver.yaml", "Read"),
2785
+ file("/etc/kubernetes/pki/ca.crt", "Read"),
2786
+ file("/etc/rancher/k3s/config.yaml", "Read"),
2787
+ file("/opt/etc/app.conf", "Grep"),
2788
+ file("/repo/.git/HEAD", "Read"),
2789
+ file("/repo/.gitconfig.example", "Read"),
2790
+ file("mcp.json.example", "Read"),
2791
+ file("/repo/.claude/settings.json", "Read"),
2792
+ file("/repo/claude.json", "Read"),
2793
+ file("/repo/.cursor/rules/style.mdc", "Read"),
2794
+ file("/repo/codex/config.toml", "Read"),
2795
+ file("config/database.staging.yml", "Read"),
2796
+ // Production code, prose and vendored files are not production configuration.
2797
+ file("node_modules/react/cjs/react.production.min.js", "Read"),
2798
+ file("node_modules/react-router/dist/production/index.d.ts", "Grep"),
2799
+ // One vendored configuration file per production arm.
2800
+ file("node_modules/some-lib/config/app.prod.json", "Read"),
2801
+ file("dist/prod.json", "Read"),
2802
+ file("node_modules/some-lib/config/app.production.json", "Grep"),
2803
+ file("vendor/config/production.yml", "Read"),
2804
+ file("dist/prod/app.json", "Read"),
2805
+ file("vendor/production/config.yml", "Grep"),
2806
+ file("src/Settings.prod.test.tsx", "Read"),
2807
+ file("infra/bin/prod.ts", "Read"),
2808
+ file("webpack.prod.js", "Grep"),
2809
+ file("config/database.prod.md", "Read"),
2810
+ file("config/prod.md", "Read"),
2811
+ file("config/app.production.mdx", "Read"),
2812
+ file("config/production.txt", "Read"),
2813
+ file("deploy/prod/RUNBOOK.txt", "Grep"),
2814
+ file("docs/production/README.md", "Read"),
2815
+ // The read-only arms do not hold an edit: the guardrail that owns each path does.
2816
+ file("/etc/shadow", "Edit"),
2817
+ file("/etc/shadow-", "Write"),
2818
+ file("/etc/sudoers.d/admins", "Write"),
2819
+ file("/etc/ssh/ssh_host_ed25519_key", "Write"),
2820
+ file("/etc/ssh/ssh_host_key", "Edit"),
2821
+ file("/etc/ssl/private/server.key", "Edit"),
2822
+ file("/etc/pki/tls/private/server.key", "Write"),
2823
+ file("/etc/kubernetes/admin.conf", "Write"),
2824
+ file("/etc/kubernetes/pki/sa.key", "Write"),
2825
+ file("/etc/rancher/k3s/k3s.yaml", "Edit"),
2826
+ file("/etc/hosts", "Edit"),
2827
+ file("/repo/.git/config", "Edit"),
2828
+ file(".mcp.json", "Edit"),
2829
+ file("/repo/.claude/settings.local.json", "Write"),
2830
+ file("/Users/dev/.claude.json", "Write"),
2831
+ file("/repo/.cursor/mcp.json", "Edit"),
2832
+ file("/Users/dev/.codex/config.toml", "Edit"),
2833
+ file("config/database.prod.yml", "Edit"),
2834
+ file("config/prod.json", "Write"),
2835
+ file("config/app.production.json", "Edit"),
2836
+ file("config/production.yaml", "Write"),
2837
+ file("deploy/prod/values.yaml", "Edit"),
2838
+ file("k8s/production/secrets.yaml", "Write")
2640
2839
  ]
2641
2840
  }
2642
2841
  };
@@ -3725,8 +3924,8 @@ function isPack(value) {
3725
3924
  }
3726
3925
 
3727
3926
  // src/stamp.ts
3728
- var CATALOG_VERSION = "0.2.4";
3729
- var CATALOG_PUBLISHED_AT = "2026-10-16T16:15:37Z";
3927
+ var CATALOG_VERSION = "0.2.6";
3928
+ var CATALOG_PUBLISHED_AT = "2026-10-22T16:18:01Z";
3730
3929
 
3731
3930
  // src/rules.ts
3732
3931
  var RULES_BY_PACK = {
@@ -3776,4 +3975,4 @@ export {
3776
3975
  getRule,
3777
3976
  rulesForPack
3778
3977
  };
3779
- //# sourceMappingURL=chunk-6YROGDEH.js.map
3978
+ //# sourceMappingURL=chunk-XIRL7M4H.js.map