@atlasauth/pca-policy-ci 0.1.0 → 0.3.0

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/package.json +28 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Atlas Authorization
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @atlasauth/pca-policy-ci
2
+
3
+ A CI gate for Proof-Carrying Authority (PCA) policies. It statically analyzes an envelope, a minted grant, or a delegation chain and reports findings so an unsafe policy fails the build before it ships. It is driven by the `@atlasauth/pca-analyzer` decision procedure.
4
+
5
+ Rules (each can be toggled):
6
+
7
+ - `over-broad-grant`: wildcard verb or resource, a provable always-allow, or a dangerous verb with no narrowing condition
8
+ - `privilege-escalation`: a delegation hop whose authority is not a subset of its parent
9
+ - `redundant-caveat`: a duplicate, subsumed, unsatisfiable, or non-binding caveat or condition
10
+ - `dangerous-reachability`: a dangerous action provably reachable with no budget, rate, or step-up gate
11
+ - `missing-safety-floor`: no expiry, or no blast-radius, rate, or budget gate on a non-trivial grant
12
+
13
+ A hard `error` is only emitted from a proven analyzer verdict; undecidable features (regex resources, cross-field refs, over-large grids) degrade to a `warn` or `info` that says so.
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npm i -D @atlasauth/pca-policy-ci
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ CLI:
24
+
25
+ ```sh
26
+ npx pca-policy-ci policies/*.json [--max-severity error|warn|info] [--format text|github] [--quiet]
27
+ ```
28
+
29
+ Each file is a JSON envelope, grant, compiled policy, `{ predicates, caveats }`, or an array (treated as a delegation chain). The exit code is non-zero when any finding reaches `--max-severity` (default `error`). `--format github` emits GitHub Actions annotations.
30
+
31
+ Library:
32
+
33
+ ```ts
34
+ import { lint, lintPolicies } from '@atlasauth/pca-policy-ci';
35
+
36
+ const findings = lint({
37
+ predicates: [{ verb: '*', resource: '*' }],
38
+ caveats: [],
39
+ });
40
+ // [{ rule: 'over-broad-grant', severity: 'error', message: '...', where: 'predicates[0]' }, ...]
41
+
42
+ const summary = lintPolicies(
43
+ [{ label: 'refund-agent', policy: envelope }],
44
+ { maxSeverity: 'warn' },
45
+ );
46
+ process.exit(summary.exitCode);
47
+ ```
48
+
49
+ ## API
50
+
51
+ - `lint(input, opts?)`: dispatches to `lintPolicy` (single policy) or `lintChain` (array)
52
+ - `lintPolicies(items, opts?)`: labeled batch, returns a `LintSummary` with `counts`, `ok`, `exitCode`
53
+ - `summarize(results, opts?)`, `normalizePolicyInput`, `DEFAULT_DANGEROUS_VERBS`
54
+ - Options: `rules` to enable/disable or tune each check (dangerous verbs, targets, safety floor)
55
+
56
+ ## Status
57
+
58
+ Part of [Proof-Carrying Authority](https://github.com/Atlas-Authorization/pca). A clean run means no rule fired, not that a policy is correct; it complements review, not replaces it.
59
+
60
+ ## License
61
+
62
+ MIT - see LICENSE
package/package.json CHANGED
@@ -1,7 +1,27 @@
1
1
  {
2
2
  "name": "@atlasauth/pca-policy-ci",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "CI gate for PCA policies: statically flag over-broad grants, privilege-escalation in delegation chains, unused/redundant caveats, and reachability of dangerous actions — fail the build before an unsafe policy ships.",
5
+ "keywords": [
6
+ "policy",
7
+ "ci",
8
+ "static analysis",
9
+ "linting",
10
+ "agent authorization",
11
+ "proof-carrying authority",
12
+ "pca",
13
+ "ai agents"
14
+ ],
15
+ "license": "MIT",
16
+ "homepage": "https://github.com/Atlas-Authorization/pca#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/Atlas-Authorization/pca/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Atlas-Authorization/pca.git",
23
+ "directory": "packages/pca-policy-ci"
24
+ },
5
25
  "bin": {
6
26
  "pca-policy-ci": "./dist/cli.js"
7
27
  },
@@ -15,8 +35,8 @@
15
35
  "./package.json": "./package.json"
16
36
  },
17
37
  "dependencies": {
18
- "@atlasauth/pca-analyzer": "0.1.0",
19
- "@atlasauth/pca": "0.1.0"
38
+ "@atlasauth/pca": "0.3.0",
39
+ "@atlasauth/pca-analyzer": "0.3.0"
20
40
  },
21
41
  "devDependencies": {
22
42
  "typescript": "^5.6.3",
@@ -24,8 +44,12 @@
24
44
  },
25
45
  "files": [
26
46
  "dist",
27
- "README.md"
47
+ "README.md",
48
+ "LICENSE"
28
49
  ],
50
+ "engines": {
51
+ "node": ">=20"
52
+ },
29
53
  "publishConfig": {
30
54
  "access": "public"
31
55
  },