@nullsquare/agent-authority 0.4.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/CONTRIBUTING.md +93 -0
- package/LICENSE +201 -0
- package/README.md +390 -0
- package/ROADMAP.md +149 -0
- package/SECURITY.md +116 -0
- package/docs/account-connections.md +173 -0
- package/docs/announcement-draft.md +13 -0
- package/docs/architecture.md +106 -0
- package/docs/assets/agent-authority-cover.svg +41 -0
- package/docs/clear-path.md +53 -0
- package/docs/cli.md +130 -0
- package/docs/evidence.md +143 -0
- package/docs/harness-bridge-mode.md +136 -0
- package/docs/harness-integration.md +223 -0
- package/docs/integration-contract.md +132 -0
- package/docs/integrations/vercel-ai-sdk.md +161 -0
- package/docs/launch-checklist.md +29 -0
- package/docs/npm-release.md +19 -0
- package/docs/openclaw-integration.md +97 -0
- package/docs/package-consumer-validation.md +18 -0
- package/docs/release-candidate-status.md +3 -0
- package/docs/release-guardrails.md +8 -0
- package/docs/release-notes-v0.4.md +26 -0
- package/docs/release-scope.md +3 -0
- package/docs/ship-criteria.md +3 -0
- package/docs/task-leases.md +253 -0
- package/docs/validation.md +124 -0
- package/examples/demo.js +19 -0
- package/examples/direct-guard.js +50 -0
- package/examples/harness-managed-connectors.js +72 -0
- package/examples/live-github-derived-mutation.js +208 -0
- package/examples/live-github-task-lease.js +80 -0
- package/examples/mission.json +20 -0
- package/examples/missions/chatgpt-web-validation.json +33 -0
- package/examples/openclaw-tool-wrapper.js +49 -0
- package/examples/task-lease-demo.js +98 -0
- package/examples/validation-mcp-upstream.js +112 -0
- package/package.json +80 -0
- package/src/agent-auth.js +135 -0
- package/src/approvals.js +157 -0
- package/src/cli.js +335 -0
- package/src/connections.js +203 -0
- package/src/execution.js +174 -0
- package/src/guard.js +79 -0
- package/src/harness-bridge.js +131 -0
- package/src/idempotency.js +118 -0
- package/src/index.js +291 -0
- package/src/integrations/ai-sdk.js +59 -0
- package/src/keys.js +15 -0
- package/src/mcp-gateway.js +142 -0
- package/src/mcp-remote.js +102 -0
- package/src/mcp-server.js +102 -0
- package/src/providers/github.js +149 -0
- package/src/runtime-env.js +53 -0
- package/src/sdk.js +75 -0
- package/src/server.js +146 -0
- package/src/storage.js +213 -0
- package/src/task-lease.js +266 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Contributing to Agent Authority
|
|
2
|
+
|
|
3
|
+
Agent Authority is being developed in public. The current goal is deliberately narrow:
|
|
4
|
+
|
|
5
|
+
> Give an agent only the authority required for the task the human approved, and prevent that authority from silently expanding as the agent crosses tools or discovers new resources.
|
|
6
|
+
|
|
7
|
+
The best contributions make that claim easier to prove in real agent stacks.
|
|
8
|
+
|
|
9
|
+
## Start here
|
|
10
|
+
|
|
11
|
+
1. Read `README.md` and `docs/task-leases.md`.
|
|
12
|
+
2. Run the Task Lease demo.
|
|
13
|
+
3. Search existing issues before opening a new one.
|
|
14
|
+
4. Keep architectural changes tied to a concrete failure mode or integration need.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/Null-Square/agent-authority.git
|
|
18
|
+
cd agent-authority
|
|
19
|
+
npm install
|
|
20
|
+
npm test
|
|
21
|
+
npm run demo:task-lease
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Node.js 20+ is required.
|
|
25
|
+
|
|
26
|
+
## What we especially want now
|
|
27
|
+
|
|
28
|
+
- integrations around `guard.run()` or Task Leases in real agent frameworks;
|
|
29
|
+
- trustworthy mappings from provider/tool outputs into resource facts;
|
|
30
|
+
- adversarial tests for authority expansion, provenance substitution and confused-deputy behavior;
|
|
31
|
+
- examples where one task safely crosses two or more systems;
|
|
32
|
+
- simple persistence designs for Task Lease state;
|
|
33
|
+
- MCP and non-MCP conformance cases that preserve the same task authority;
|
|
34
|
+
- approval UX for a genuine authority delta rather than approval on every tool call.
|
|
35
|
+
|
|
36
|
+
We are **not** prioritizing new identity protocols, a large policy DSL, a connector marketplace, or another agent harness.
|
|
37
|
+
|
|
38
|
+
## Core invariants
|
|
39
|
+
|
|
40
|
+
A contribution must not weaken these properties:
|
|
41
|
+
|
|
42
|
+
1. The mission is the ceiling. A Task Lease cannot grant an action the mission does not permit.
|
|
43
|
+
2. A blocked or step-up action cannot execute its side effect.
|
|
44
|
+
3. A derived fact must descend from existing task authority.
|
|
45
|
+
4. A derived fact must be anchored to an `ALLOW` receipt from the same Task Lease.
|
|
46
|
+
5. A request for a different concrete resource cannot silently inherit authority.
|
|
47
|
+
6. Completing or expiring a Task Lease removes its task authority even if provider credentials still exist.
|
|
48
|
+
7. Switching SDK, MCP, broker or harness transport must not broaden authority.
|
|
49
|
+
|
|
50
|
+
If a proposed feature cannot preserve these rules, explain why before implementing it.
|
|
51
|
+
|
|
52
|
+
## Derived-authority trust boundary
|
|
53
|
+
|
|
54
|
+
The v0.4 prototype records:
|
|
55
|
+
|
|
56
|
+
- parent fact IDs;
|
|
57
|
+
- source receipt ID/hash;
|
|
58
|
+
- source service/action/request hash;
|
|
59
|
+
- the trusted extraction selector.
|
|
60
|
+
|
|
61
|
+
The trusted host or adapter still supplies the extracted value. Do not describe this as cryptographic proof that the value came from the provider response. Designs that strengthen this boundary without adding a large semantic policy engine are especially valuable.
|
|
62
|
+
|
|
63
|
+
## Pull requests
|
|
64
|
+
|
|
65
|
+
Please include:
|
|
66
|
+
|
|
67
|
+
- the user/developer problem being solved;
|
|
68
|
+
- the authority boundary affected;
|
|
69
|
+
- an adversarial test showing what must remain impossible;
|
|
70
|
+
- the smallest implementation that solves the problem;
|
|
71
|
+
- documentation when observable behavior changes.
|
|
72
|
+
|
|
73
|
+
Run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run check
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
before opening a PR.
|
|
80
|
+
|
|
81
|
+
## Security rule
|
|
82
|
+
|
|
83
|
+
Do not hide trust assumptions. If an adapter cannot prevent credential exfiltration, if an extraction is trusted rather than verified, or if enforcement can be bypassed outside the wrapper, document that limitation explicitly.
|
|
84
|
+
|
|
85
|
+
Never commit passwords, API keys, OAuth refresh tokens, session cookies, customer data, or private production configuration.
|
|
86
|
+
|
|
87
|
+
## Protocol proposals
|
|
88
|
+
|
|
89
|
+
Do not add a new wire format simply because it is elegant. Agent Authority should consume existing OAuth/OIDC, MCP and workload-identity mechanisms where they already solve the transport or authentication problem.
|
|
90
|
+
|
|
91
|
+
A new protocol concept needs evidence from multiple real integrations that the existing mechanisms cannot represent the required task-authority behavior.
|
|
92
|
+
|
|
93
|
+
Disagreement is useful. Critique designs and assumptions, not contributors.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 NullSquare
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
# Agent Authority
|
|
6
|
+
|
|
7
|
+
### Give your agent a task, not your account.
|
|
8
|
+
|
|
9
|
+
**Agent Authority turns a human-approved task into temporary execution authority, then keeps that authority bounded as the agent discovers resources, crosses tools, and performs side effects.**
|
|
10
|
+
|
|
11
|
+
[Task Leases](docs/task-leases.md) · [Validate](docs/validation.md) · [Integration contract](docs/integration-contract.md) · [CLI](docs/cli.md) · [Architecture](docs/architecture.md) · [Roadmap](ROADMAP.md) · [Contributing](CONTRIBUTING.md)
|
|
12
|
+
|
|
13
|
+
> **Status: public pre-alpha / v0.4 validation candidate.** The repository has a working policy runtime, protocol-neutral guard, Task Lease prototype with provenance-bound derived facts, approvals, revocation, idempotency, credential isolation, MCP v2 gateway, GitHub brokered execution, CI and CodeQL. It is not production-ready yet.
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
## The problem
|
|
18
|
+
|
|
19
|
+
AI agents increasingly receive broad provider permissions so they can complete narrow human tasks.
|
|
20
|
+
|
|
21
|
+
A user says:
|
|
22
|
+
|
|
23
|
+
> **Handle the demo request in this email thread.**
|
|
24
|
+
|
|
25
|
+
The agent may need to:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Gmail -> read one thread
|
|
29
|
+
|
|
|
30
|
+
v
|
|
31
|
+
discover sender
|
|
32
|
+
|
|
|
33
|
+
v
|
|
34
|
+
Calendar -> create one meeting with that sender
|
|
35
|
+
|
|
|
36
|
+
v
|
|
37
|
+
Gmail -> reply in the originating thread
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The underlying OAuth connections may permit reading every email, creating meetings with anyone, or sending mail to anyone.
|
|
41
|
+
|
|
42
|
+
Traditional authorization answers:
|
|
43
|
+
|
|
44
|
+
> Can this application use Calendar?
|
|
45
|
+
|
|
46
|
+
Agent Authority asks a narrower question immediately before the side effect:
|
|
47
|
+
|
|
48
|
+
> **Is this exact effect justified by the task the human authorized?**
|
|
49
|
+
|
|
50
|
+
## Task-bounded autonomy
|
|
51
|
+
|
|
52
|
+
Agent Authority is trying to make this trade-off unnecessary:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
broad standing permissions
|
|
56
|
+
OR
|
|
57
|
+
approve every tool call
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The target is:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
one meaningful task approval
|
|
64
|
+
|
|
|
65
|
+
v
|
|
66
|
+
temporary bounded authority
|
|
67
|
+
|
|
|
68
|
+
+--> safe task actions proceed
|
|
69
|
+
+--> unrelated resources are blocked
|
|
70
|
+
+--> real authority expansion requires step-up
|
|
71
|
+
|
|
|
72
|
+
v
|
|
73
|
+
task completes -> authority disappears
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The provider credential may continue to exist. The **task authority does not**.
|
|
77
|
+
|
|
78
|
+
## The key idea: authority can follow trusted task data
|
|
79
|
+
|
|
80
|
+
Many resources do not exist in the original prompt. The agent discovers them while working.
|
|
81
|
+
|
|
82
|
+
Agent Authority models this with a **Task Lease**:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Human-approved task
|
|
86
|
+
|
|
|
87
|
+
v
|
|
88
|
+
authority root
|
|
89
|
+
Gmail thread #91
|
|
90
|
+
|
|
|
91
|
+
authorized read
|
|
92
|
+
|
|
|
93
|
+
v
|
|
94
|
+
derived fact
|
|
95
|
+
customer@example.com
|
|
96
|
+
|
|
|
97
|
+
v
|
|
98
|
+
exact binding
|
|
99
|
+
Calendar attendee must equal that sender
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
A request for `customer@example.com` can proceed.
|
|
103
|
+
|
|
104
|
+
A request for `other@example.com` does not silently inherit the same authority. It becomes an **authority delta** and requires step-up.
|
|
105
|
+
|
|
106
|
+
This is **derived authority**: authority follows a resource discovered through authorized execution, but never broadens into a standing wildcard permission.
|
|
107
|
+
|
|
108
|
+
See [Task Leases and Derived Authority](docs/task-leases.md).
|
|
109
|
+
|
|
110
|
+
## Core invariant
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
Task Lease authority <= Mission authority
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The mission remains the ceiling. A Task Lease may narrow an action to resources discovered during the task, but it cannot grant an action that the mission already denies or never allowed.
|
|
117
|
+
|
|
118
|
+
More generally:
|
|
119
|
+
|
|
120
|
+
> **Authority may stay the same or shrink as it moves through agents, tools and transports. It must never silently grow.**
|
|
121
|
+
|
|
122
|
+
## Run the derived-authority demo
|
|
123
|
+
|
|
124
|
+
Requirements: Node.js 20+.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git clone https://github.com/Null-Square/agent-authority.git
|
|
128
|
+
cd agent-authority
|
|
129
|
+
npm install
|
|
130
|
+
npm test
|
|
131
|
+
npm run demo:task-lease
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The demo performs this flow without provider credentials:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
1. ALLOW read of one task-authorized Gmail thread
|
|
138
|
+
2. derive sender email from that same Task Lease receipt
|
|
139
|
+
3. ALLOW Calendar event for that sender
|
|
140
|
+
4. REQUIRE_APPROVAL for a different attendee
|
|
141
|
+
5. complete task
|
|
142
|
+
6. DENY subsequent actions
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The side-effect callbacks for blocked actions never run.
|
|
146
|
+
|
|
147
|
+
## Minimal developer API
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
import { AuthorityRuntime } from '@nullsquare/agent-authority';
|
|
151
|
+
import { createTaskLease } from '@nullsquare/agent-authority/task-lease';
|
|
152
|
+
import { createTaskLeaseGuard } from '@nullsquare/agent-authority/guard';
|
|
153
|
+
|
|
154
|
+
const lease = createTaskLease({
|
|
155
|
+
mission,
|
|
156
|
+
request: 'Handle the demo request in thread:demo-91',
|
|
157
|
+
roots: [
|
|
158
|
+
{ fact_id: 'fact:thread', kind: 'gmail.thread', value: 'thread:demo-91' }
|
|
159
|
+
],
|
|
160
|
+
bindings: [
|
|
161
|
+
{
|
|
162
|
+
service: 'calendar',
|
|
163
|
+
action: 'event.create',
|
|
164
|
+
context_field: 'attendee',
|
|
165
|
+
fact_id: 'fact:sender-email'
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const guard = createTaskLeaseGuard({
|
|
171
|
+
lease,
|
|
172
|
+
runtime: new AuthorityRuntime()
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const read = await guard.run({
|
|
176
|
+
service: 'gmail',
|
|
177
|
+
action: 'thread.read',
|
|
178
|
+
context: { thread: 'thread:demo-91' }
|
|
179
|
+
}, () => gmail.readThread('thread:demo-91'));
|
|
180
|
+
|
|
181
|
+
lease.derive({
|
|
182
|
+
fact_id: 'fact:sender-email',
|
|
183
|
+
kind: 'email.address',
|
|
184
|
+
value: read.output.sender,
|
|
185
|
+
from: ['fact:thread'],
|
|
186
|
+
receipt: read.receipt,
|
|
187
|
+
selector: 'output.sender'
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
await guard.run({
|
|
191
|
+
service: 'calendar',
|
|
192
|
+
action: 'event.create',
|
|
193
|
+
context: { attendee: read.output.sender }
|
|
194
|
+
}, () => calendar.createEvent({ attendee: read.output.sender }));
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The host keeps its existing SDK, connector and authentication. Agent Authority controls whether the effect may happen.
|
|
198
|
+
|
|
199
|
+
## Three integration modes, one authority model
|
|
200
|
+
|
|
201
|
+
Agent Authority is deliberately **not tied to MCP, OAuth, or one agent framework**.
|
|
202
|
+
|
|
203
|
+
### 1. In-process guard
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
agent code -> guard.run() -> existing SDK / API
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Best when the application already owns the provider connection. This is the primary v0.4 adoption path.
|
|
210
|
+
|
|
211
|
+
### 2. MCP gateway
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
MCP host -> Agent Authority -> existing MCP server
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Best when the harness already speaks MCP. MCP is an integration transport, not the product identity.
|
|
218
|
+
|
|
219
|
+
### 3. Brokered execution
|
|
220
|
+
|
|
221
|
+
```text
|
|
222
|
+
agent -> Agent Authority -> isolated credential -> provider
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Best when the agent should not receive the provider credential at all.
|
|
226
|
+
|
|
227
|
+
The long-term validation target is the **same Task Lease and authority lineage across all three paths**.
|
|
228
|
+
|
|
229
|
+
## What is implemented
|
|
230
|
+
|
|
231
|
+
### Task authority
|
|
232
|
+
|
|
233
|
+
- mission validation and deterministic `ALLOW / DENY / REQUIRE_APPROVAL`
|
|
234
|
+
- explicit deny precedence
|
|
235
|
+
- resource/context constraints
|
|
236
|
+
- expiry and cumulative budgets
|
|
237
|
+
- delegation attenuation
|
|
238
|
+
- durable mission revocation
|
|
239
|
+
- Task Lease prototype
|
|
240
|
+
- explicit authority roots
|
|
241
|
+
- same-lease provenance-bound derived facts
|
|
242
|
+
- required parent lineage and trusted extraction selector
|
|
243
|
+
- exact context-field bindings
|
|
244
|
+
- authority-delta step-up signal
|
|
245
|
+
- immediate task completion/expiry enforcement
|
|
246
|
+
- Task Lease IDs/hashes in decision receipts
|
|
247
|
+
|
|
248
|
+
### Enforcement
|
|
249
|
+
|
|
250
|
+
- protocol-neutral `guard.run()` wrapper
|
|
251
|
+
- blocked side effects never invoke their callback
|
|
252
|
+
- one-time human approvals bound to exact request
|
|
253
|
+
- mutation idempotency
|
|
254
|
+
- conservative uncertain-state handling
|
|
255
|
+
- signed harness action grants
|
|
256
|
+
- MCP v2 read-only gateway/proxy
|
|
257
|
+
|
|
258
|
+
### Credentials and runtime
|
|
259
|
+
|
|
260
|
+
- persistent connection metadata
|
|
261
|
+
- AES-256-GCM local encrypted secret store
|
|
262
|
+
- safe reconnect cleanup
|
|
263
|
+
- GitHub brokered execution without returning the token to the agent
|
|
264
|
+
- short-lived signed local agent-instance tokens
|
|
265
|
+
- local CLI/daemon
|
|
266
|
+
|
|
267
|
+
### Engineering quality
|
|
268
|
+
|
|
269
|
+
- adversarial authorization tests
|
|
270
|
+
- Node 20 and Node 22 CI
|
|
271
|
+
- coverage run
|
|
272
|
+
- package checks
|
|
273
|
+
- CodeQL
|
|
274
|
+
|
|
275
|
+
## What is different from OAuth, IAM and MCP authorization?
|
|
276
|
+
|
|
277
|
+
Agent Authority is **not trying to replace them**.
|
|
278
|
+
|
|
279
|
+
OAuth/IAM answer who or what may access a provider and with which standing scopes. MCP authorization protects an MCP transport. Agent Authority operates at a different boundary:
|
|
280
|
+
|
|
281
|
+
```text
|
|
282
|
+
human task
|
|
283
|
+
|
|
|
284
|
+
v
|
|
285
|
+
temporary task authority
|
|
286
|
+
|
|
|
287
|
+
v
|
|
288
|
+
exact agent-originated effect
|
|
289
|
+
|
|
|
290
|
+
+--> existing OAuth / IAM / MCP / SDK / CLI
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
The project should consume existing identity/authentication mechanisms and emerging standards rather than invent another login or token format.
|
|
294
|
+
|
|
295
|
+
The contribution we are testing is operational: **make task-scoped, provenance-aware least privilege usable inside ordinary agent stacks.**
|
|
296
|
+
|
|
297
|
+
## Example use cases
|
|
298
|
+
|
|
299
|
+
### Support / sales
|
|
300
|
+
|
|
301
|
+
> Handle this customer request.
|
|
302
|
+
|
|
303
|
+
Bind later actions to the customer, thread, ticket or meeting discovered from the authorized task path.
|
|
304
|
+
|
|
305
|
+
### Finance
|
|
306
|
+
|
|
307
|
+
> Refund the customer from this ticket, but never more than the original charge.
|
|
308
|
+
|
|
309
|
+
Discover customer -> order -> charge through authorized reads, then bind the refund to those concrete facts and amount ceiling.
|
|
310
|
+
|
|
311
|
+
### Coding / operations
|
|
312
|
+
|
|
313
|
+
> Fix issue #42, open a PR, do not merge or deploy production.
|
|
314
|
+
|
|
315
|
+
Keep repo/issue/branch authority bounded as subagents and tools change.
|
|
316
|
+
|
|
317
|
+
### Personal / company operating agents
|
|
318
|
+
|
|
319
|
+
> Handle this email.
|
|
320
|
+
|
|
321
|
+
Allow a natural workflow across mail, calendar, CRM and internal systems without turning every connected account into ambient agent authority.
|
|
322
|
+
|
|
323
|
+
## Security principles
|
|
324
|
+
|
|
325
|
+
1. **Task before credential.** A provider token is not task authority.
|
|
326
|
+
2. **Mission is the ceiling.** Task Leases cannot override explicit denies.
|
|
327
|
+
3. **No side effect before authorization.** Denied and step-up actions never execute.
|
|
328
|
+
4. **Authority lineage matters.** Derived facts require an authorized receipt from the same Task Lease, at least one existing parent fact, and a recorded extraction selector.
|
|
329
|
+
5. **No silent resource expansion.** A different concrete resource becomes an authority delta.
|
|
330
|
+
6. **Task authority ends with the task.** Completion and expiry are independent from provider credential lifetime.
|
|
331
|
+
7. **Authority may shrink, never silently grow.** Delegation and transport changes must preserve non-amplification.
|
|
332
|
+
8. **The evaluated request must be the executed request.** Request hashes, grants and idempotency protect the boundary.
|
|
333
|
+
9. **Credentials stay out of model context where Agent Authority owns them.**
|
|
334
|
+
10. **Security gaps are documented, not marketed away.**
|
|
335
|
+
|
|
336
|
+
See [SECURITY.md](SECURITY.md).
|
|
337
|
+
|
|
338
|
+
## Current limitations
|
|
339
|
+
|
|
340
|
+
This is still a validation implementation.
|
|
341
|
+
|
|
342
|
+
- Task Lease state is currently process-local.
|
|
343
|
+
- Derived-value extraction is trusted to the host/adapter; v0.4 records the source receipt and selector but does not yet cryptographically prove extraction from the provider response.
|
|
344
|
+
- Bindings currently target top-level request context fields.
|
|
345
|
+
- Approved authority deltas are surfaced but not automatically applied back into a live lease.
|
|
346
|
+
- GitHub token-stdin is a developer bridge, not final browser OAuth onboarding.
|
|
347
|
+
- The encrypted local vault is not an OS keychain/KMS/HSM backend.
|
|
348
|
+
- Remote authenticated deployment and a production approval UX are not complete.
|
|
349
|
+
|
|
350
|
+
These are follow-on validation problems. We are intentionally not solving them with a giant policy language or another agent framework.
|
|
351
|
+
|
|
352
|
+
## What we are deliberately not building
|
|
353
|
+
|
|
354
|
+
- another agent harness
|
|
355
|
+
- another OAuth or identity protocol
|
|
356
|
+
- an MCP replacement
|
|
357
|
+
- a connector marketplace
|
|
358
|
+
- a giant proprietary policy DSL
|
|
359
|
+
- an enterprise dashboard before the enforcement primitive proves adoption
|
|
360
|
+
|
|
361
|
+
## Contributing
|
|
362
|
+
|
|
363
|
+
The best contribution is not another abstract feature. It is a real integration or adversarial case that answers:
|
|
364
|
+
|
|
365
|
+
> **Can this agent complete the intended task while being technically unable to use the same underlying account authority for an unrelated effect?**
|
|
366
|
+
|
|
367
|
+
We especially want:
|
|
368
|
+
|
|
369
|
+
- framework integrations around `guard.run()`;
|
|
370
|
+
- trustworthy operation -> resource-context mappings;
|
|
371
|
+
- Task Lease examples from real workflows;
|
|
372
|
+
- derived-authority / provenance attacks;
|
|
373
|
+
- MCP and non-MCP conformance cases;
|
|
374
|
+
- secure persistence and extraction-verification designs that stay simple.
|
|
375
|
+
|
|
376
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
377
|
+
|
|
378
|
+
## License
|
|
379
|
+
|
|
380
|
+
Apache-2.0.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
<div align="center">
|
|
385
|
+
|
|
386
|
+
Built in public by **NullSquare**.
|
|
387
|
+
|
|
388
|
+
**Give your agent a task, not your account.**
|
|
389
|
+
|
|
390
|
+
</div>
|