@atlasauth/pca-analyzer 0.1.0 → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +42 -22
- package/package.json +26 -3
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
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
# @atlasauth/pca-analyzer
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
bound and verify one action, but on its own it cannot statically answer *"what can this whole delegated
|
|
5
|
-
authority ever do?"* This package decides that over PCA's predicate/caveat policy — the conceptual gap
|
|
6
|
-
the roadmap flagged — without a heavyweight SMT dependency.
|
|
3
|
+
Static analyzability of authority for Proof-Carrying Authority (PCA). PCA can verify one action and prove a quantitative trust-budget bound, but on its own it cannot answer "what can this whole delegated authority ever do?". This package decides that over PCA's predicate/caveat policy (reachability, vacuity, totality, delegation-safety subsumption, disjointness, equivalence, and conformance to a declared intent) without an SMT dependency.
|
|
7
4
|
|
|
8
|
-
It is a sound,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
It is a sound, bounded decision procedure in the spirit of AWS Cedar's symbolic compiler (SymCC, arXiv:2403.04651), which decides policy equivalence, subsumption and always-allow/deny with counterexamples. Instead of discharging to Z3, it exploits a finite-distinguishing-value property of PCA's predicate theory and decides by enumeration against the real `evaluatePredicates` from `@atlasauth/pca`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i @atlasauth/pca-analyzer @atlasauth/pca
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { compilePolicy } from '@atlasauth/pca';
|
|
17
|
+
import { subsumes, intentConformance, reachable } from '@atlasauth/pca-analyzer';
|
|
18
|
+
|
|
19
|
+
const parent = compilePolicy({ permissions: { stripe: ['refund'] }, limits: { refund: '$500' } });
|
|
20
|
+
const child = compilePolicy({ permissions: { stripe: ['refund'] }, limits: { refund: '$100' } });
|
|
21
|
+
|
|
22
|
+
// Delegation safety: a child must not widen its parent.
|
|
23
|
+
subsumes(parent, child).subsumes; // true
|
|
24
|
+
subsumes(child, parent); // { subsumes: false, counterexample: { verb: 'stripe.refund', params: { amount: 300 }, ... } }
|
|
25
|
+
|
|
26
|
+
// Can any input complete this action into an ALLOW? Returns a verified witness.
|
|
27
|
+
reachable(parent, { verb: 'stripe.refund', resource: 'charge:1', params: { amount: 50 } }); // { reachable: true, witness }
|
|
28
|
+
|
|
29
|
+
// Intent conformance: does the authority stay inside what was meant?
|
|
30
|
+
const policy = compilePolicy({ permissions: { stripe: ['refund'] }, limits: { refund: '$20000' } });
|
|
31
|
+
const r = intentConformance(policy, { verbs: ['stripe.refund'], maxAmount: 10000 });
|
|
32
|
+
// r.conforms === false; r.violations[0].kinds includes 'over-amount'
|
|
33
|
+
```
|
|
13
34
|
|
|
14
35
|
## Queries
|
|
15
36
|
|
|
@@ -27,21 +48,11 @@ witness.
|
|
|
27
48
|
| `equivalent(a, b)` | Do the two admit exactly the same actions? |
|
|
28
49
|
| `intentConformance(policy, intent)` | Does the policy admit **only** actions inside a declared intent envelope (verbs + resource scopes + amount ceiling)? |
|
|
29
50
|
|
|
30
|
-
`intentConformance` is
|
|
51
|
+
`intentConformance` is a safety check distinct from the runtime trust-budget. It catches the
|
|
31
52
|
*"a $14k renewal under a $10k cap on an approved vendor still violates intent"* class: an action that
|
|
32
53
|
passes the policy's predicates and stays under budget, yet falls outside what the principal intended,
|
|
33
54
|
because the policy's own ceiling is higher than (or absent relative to) the intent cap.
|
|
34
55
|
|
|
35
|
-
```ts
|
|
36
|
-
import { subsumes, intentConformance } from '@atlasauth/pca-analyzer';
|
|
37
|
-
|
|
38
|
-
// Delegation safety: a child capability must not widen its parent.
|
|
39
|
-
const ok = subsumes(parentPolicy, childPolicy).subsumes; // false => counterexample attached
|
|
40
|
-
|
|
41
|
-
// Intent conformance: does the authority stay inside what was meant?
|
|
42
|
-
const r = intentConformance(policy, { verbs: ['stripe.refund'], maxAmount: 10000 });
|
|
43
|
-
// r.conforms === false, r.violations[].kinds includes 'over-amount' for the $14k action
|
|
44
|
-
```
|
|
45
56
|
|
|
46
57
|
## How it decides (the engine)
|
|
47
58
|
|
|
@@ -86,5 +97,14 @@ favourably chosen, and the one action-tied caveat, `reversibility_max`, becomes
|
|
|
86
97
|
enumeration is performed.
|
|
87
98
|
|
|
88
99
|
The soundness contract: a proven verdict (`approximate` falsy) is correct for the fragment above; an
|
|
89
|
-
`approximate` verdict is never a false "safe".
|
|
90
|
-
|
|
100
|
+
`approximate` verdict is never a false "safe".
|
|
101
|
+
|
|
102
|
+
## Status
|
|
103
|
+
|
|
104
|
+
Experimental. Verdicts without `approximate: true` are exact for the fragment listed above; the cryptography in `@atlasauth/pca` is unaudited, though this package performs no cryptography itself. An external SMT backend for the regex and cross-field fragments is not included.
|
|
105
|
+
|
|
106
|
+
Source and issues: https://github.com/Atlas-Authorization/pca
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-analyzer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Static authority analyzer for Proof-Carrying Authority: a sound, bounded decision procedure over PCA's predicate/caveat policy (reachability, vacuity/totality, delegation-safety subsumption, disjointness, equivalence, and declared-intent conformance) with counterexamples.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"static analysis",
|
|
7
|
+
"policy analysis",
|
|
8
|
+
"reachability",
|
|
9
|
+
"agent authorization",
|
|
10
|
+
"proof-carrying authority",
|
|
11
|
+
"pca",
|
|
12
|
+
"ai agents"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
22
|
+
"directory": "packages/pca-analyzer"
|
|
23
|
+
},
|
|
5
24
|
"main": "./dist/index.js",
|
|
6
25
|
"types": "./dist/index.d.ts",
|
|
7
26
|
"exports": {
|
|
@@ -12,7 +31,7 @@
|
|
|
12
31
|
"./package.json": "./package.json"
|
|
13
32
|
},
|
|
14
33
|
"dependencies": {
|
|
15
|
-
"@atlasauth/pca": "0.
|
|
34
|
+
"@atlasauth/pca": "0.2.0"
|
|
16
35
|
},
|
|
17
36
|
"devDependencies": {
|
|
18
37
|
"typescript": "^5.6.3",
|
|
@@ -20,8 +39,12 @@
|
|
|
20
39
|
},
|
|
21
40
|
"files": [
|
|
22
41
|
"dist",
|
|
23
|
-
"README.md"
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
24
44
|
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20"
|
|
47
|
+
},
|
|
25
48
|
"publishConfig": {
|
|
26
49
|
"access": "public"
|
|
27
50
|
},
|