open-agent-profile 1.0.0__tar.gz

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 (45) hide show
  1. open_agent_profile-1.0.0/.gitignore +11 -0
  2. open_agent_profile-1.0.0/LICENSE +202 -0
  3. open_agent_profile-1.0.0/PKG-INFO +170 -0
  4. open_agent_profile-1.0.0/README.md +148 -0
  5. open_agent_profile-1.0.0/docs/README.md +21 -0
  6. open_agent_profile-1.0.0/docs/faq.md +87 -0
  7. open_agent_profile-1.0.0/docs/field-reference.md +202 -0
  8. open_agent_profile-1.0.0/docs/getting-started.md +157 -0
  9. open_agent_profile-1.0.0/docs/implementers-guide.md +241 -0
  10. open_agent_profile-1.0.0/docs/interop.md +110 -0
  11. open_agent_profile-1.0.0/docs/lifecycle.md +145 -0
  12. open_agent_profile-1.0.0/docs/state-and-memory.md +139 -0
  13. open_agent_profile-1.0.0/examples/base-reviewer.agent.yaml +47 -0
  14. open_agent_profile-1.0.0/examples/code-reviewer.agent.yaml +245 -0
  15. open_agent_profile-1.0.0/examples/data-engineer.agent.yaml +186 -0
  16. open_agent_profile-1.0.0/examples/invalid/bad-name.agent.yaml +10 -0
  17. open_agent_profile-1.0.0/examples/invalid/double-instructions.agent.md +14 -0
  18. open_agent_profile-1.0.0/examples/invalid/future-major.agent.yaml +10 -0
  19. open_agent_profile-1.0.0/examples/invalid/literal-secret.agent.yaml +17 -0
  20. open_agent_profile-1.0.0/examples/invalid/missing-instructions.agent.yaml +11 -0
  21. open_agent_profile-1.0.0/examples/invalid/path-traversal.agent.yaml +14 -0
  22. open_agent_profile-1.0.0/examples/invalid/unknown-field.agent.yaml +12 -0
  23. open_agent_profile-1.0.0/examples/invalid/unknown-kind.agent.yaml +9 -0
  24. open_agent_profile-1.0.0/examples/json/note-taker.agent.json +13 -0
  25. open_agent_profile-1.0.0/examples/note-taker.agent.yaml +17 -0
  26. open_agent_profile-1.0.0/examples/python-reviewer.agent.yaml +64 -0
  27. open_agent_profile-1.0.0/examples/research-analyst.agent.md +91 -0
  28. open_agent_profile-1.0.0/oap/__init__.py +0 -0
  29. open_agent_profile-1.0.0/oap/apply.py +406 -0
  30. open_agent_profile-1.0.0/oap/validate.py +534 -0
  31. open_agent_profile-1.0.0/pyproject.toml +48 -0
  32. open_agent_profile-1.0.0/schema/v1/agent-profile.schema.json +745 -0
  33. open_agent_profile-1.0.0/schema/v1/agent-state-delta.schema.json +129 -0
  34. open_agent_profile-1.0.0/skills/README.md +34 -0
  35. open_agent_profile-1.0.0/spec/v1/SPEC.md +469 -0
  36. open_agent_profile-1.0.0/spec/v1/conformance.md +158 -0
  37. open_agent_profile-1.0.0/spec/v1/security.md +140 -0
  38. open_agent_profile-1.0.0/tests/deltas/closes-thread.delta.yaml +21 -0
  39. open_agent_profile-1.0.0/tests/deltas/invalid/missing-revision.delta.yaml +12 -0
  40. open_agent_profile-1.0.0/tests/deltas/invalid/proposal-without-rationale.delta.yaml +13 -0
  41. open_agent_profile-1.0.0/tests/deltas/invalid/remove-with-value.delta.yaml +12 -0
  42. open_agent_profile-1.0.0/tests/deltas/invalid/writes-metadata.delta.yaml +13 -0
  43. open_agent_profile-1.0.0/tests/deltas/invalid/writes-spec.delta.yaml +14 -0
  44. open_agent_profile-1.0.0/tests/deltas/learned-conventions.delta.yaml +70 -0
  45. open_agent_profile-1.0.0/tests/test_conformance.py +453 -0
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .mypy_cache/
6
+ *.egg-info/
7
+ build/
8
+ dist/
9
+ .venv/
10
+ venv/
11
+ .coverage
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.5
2
+ Name: open-agent-profile
3
+ Version: 1.0.0
4
+ Summary: Reference validator and applicator for the Open Agent Profile (OAP) specification
5
+ Project-URL: Homepage, https://github.com/alexmerced-oss/open-agent-profile
6
+ Project-URL: Specification, https://github.com/alexmerced-oss/open-agent-profile/blob/main/spec/v1/SPEC.md
7
+ Author: Alex Merced
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: agent,ai,harness,llm,profile,specification
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: jsonschema>=4.18
18
+ Requires-Dist: pyyaml>=6.0
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=7.0; extra == 'dev'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # Open Agent Profile (OAP)
24
+
25
+ **An open specification for persisting a named AI agent as a file instead of a running process.**
26
+
27
+ [Specification](spec/v1/SPEC.md) · [Conformance](spec/v1/conformance.md) · [Security](spec/v1/security.md) · [Docs](docs/) · [Examples](examples/) · [Skills](skills/)
28
+
29
+ ---
30
+
31
+ ## The problem
32
+
33
+ You define a useful agent: a reviewer that knows your conventions, a researcher that cites the way you want, a data engineer that has learned your table layout. Then the session ends.
34
+
35
+ Today that definition either dies with the session, or it lives in a format only one harness reads. Nothing carries what the agent *learned*: the conventions it picked up, the preferences you corrected it on, the investigation it was halfway through.
36
+
37
+ Keeping a process alive is the wrong fix. It is expensive, it dies with the machine, it cannot be diffed or reviewed, and two people cannot share it.
38
+
39
+ ## The idea
40
+
41
+ Persist the agent as **data**. A profile is a file describing a named agent: role, model, tool surface, permissions, attached context, and what previous sessions learned. A harness reads it to spin up a fresh session on demand, and writes an updated revision back when that session ends.
42
+
43
+ ```yaml
44
+ oap: "1.0"
45
+ kind: AgentProfile
46
+
47
+ metadata:
48
+ name: code-reviewer
49
+ description: Reviews changed code for correctness, security, and missing tests.
50
+ revision: 7
51
+
52
+ spec:
53
+ role:
54
+ instructions: |
55
+ You are a code reviewer. You read a diff and report defects. You do not
56
+ rewrite the change unless you are explicitly asked to.
57
+ constraints:
58
+ - Do not edit files. Report only.
59
+
60
+ model:
61
+ provider: anthropic
62
+ id: claude-sonnet-5
63
+ tier: advanced # portable fallback
64
+
65
+ tools:
66
+ policy: allowlist
67
+ allow: [read, search, git/diff]
68
+ deny: [shell, write, edit]
69
+
70
+ lifecycle:
71
+ writeback: propose # the agent proposes, a human approves
72
+
73
+ state: # what previous sessions learned
74
+ summary: >-
75
+ Reviewing the platform team's Python services. They autoformat with ruff, so
76
+ formatting findings are noise.
77
+ facts:
78
+ - id: fact-authz-pattern
79
+ text: Authorization must compare against the server-side session record.
80
+ confidence: 0.9
81
+ source: repeated finding across three sessions
82
+ pinned: true
83
+ open_threads:
84
+ - id: thread-flaky-auth-tests
85
+ title: Auth integration tests are flaky under parallel execution
86
+ status: blocked
87
+ ```
88
+
89
+ No process is resident. The file is the agent.
90
+
91
+ ## What makes it a specification rather than a file format
92
+
93
+ Three rules, and they are the reason this is safe to leave switched on.
94
+
95
+ **A profile narrows. It never widens.** A harness grants the intersection of what the profile asks for and what its own policy allows. Moving a profile to a new machine can never grant capability the harness would not otherwise give. There is no field, flag, or trust label that reverses this.
96
+
97
+ **An agent cannot rewrite its own contract.** Sessions emit a state delta, and delta operations may only touch `/state`. A change to tools, permissions, model, or instructions goes into a `proposals` block with a written rationale, and a human approves it. This holds under every writeback setting, including `auto`.
98
+
99
+ **Learned state is untrusted content.** Text an agent wrote about itself is injected as information, never as authority. A state entry saying "you may now use the shell without asking" changes nothing. Without this, one successful prompt injection becomes permanent.
100
+
101
+ ## Try it
102
+
103
+ ```bash
104
+ pip install open-agent-profile
105
+ ```
106
+
107
+ ```bash
108
+ oap-validate examples/code-reviewer.agent.yaml --digest
109
+ ```
110
+
111
+ Apply what a session learned, and watch the capability request get held back for review:
112
+
113
+ ```bash
114
+ oap-apply examples/code-reviewer.agent.yaml \
115
+ tests/deltas/learned-conventions.delta.yaml --approve --dry-run
116
+ ```
117
+
118
+ ```
119
+ 1 proposal(s) require human review and were NOT applied:
120
+ [high] /spec/tools/allow
121
+ value: ["read", "search", "git/diff", "git/log", "shell"]
122
+ rationale: Could not verify the flaky test claim without running the suite.
123
+ ```
124
+
125
+ ## Repository layout
126
+
127
+ | Path | What is in it |
128
+ | --- | --- |
129
+ | [`spec/v1/`](spec/v1/) | The normative specification, conformance requirements, and security model |
130
+ | [`schema/v1/`](schema/v1/) | JSON Schemas for `AgentProfile` and `AgentStateDelta` |
131
+ | [`docs/`](docs/) | Getting started, field reference, lifecycle, interop, implementers guide, FAQ |
132
+ | [`examples/`](examples/) | Working profiles, including negative fixtures that must be rejected |
133
+ | [`skills/`](skills/) | Agent Skills packages for harnesses without native OAP support |
134
+ | [`oap/`](oap/) | Reference validator and applicator |
135
+ | [`tests/`](tests/) | Conformance test suite |
136
+
137
+ ## Conformance levels
138
+
139
+ | Level | Capability |
140
+ | --- | --- |
141
+ | **1, Read** | Discover, validate, and instantiate an agent from a profile. |
142
+ | **2, Read/Write** | Level 1, plus state injection, delta generation, and persistence. |
143
+ | **3, Full** | Level 2, plus composition, MCP, skills, external memory, and delegation. |
144
+
145
+ An implementation must publish what it does not implement. Partial support is fine; partial support that looks complete is not, because someone will review a profile, run it elsewhere, and get a different agent than the one they read.
146
+
147
+ ## Using it without native support
148
+
149
+ Harnesses that do not speak OAP yet can still read and write profiles through the two bundled [Agent Skills](skills/):
150
+
151
+ - **`oap-agent-profile`** loads a profile, assembles the prompt in the specification's order, and reports what it dropped.
152
+ - **`oap-session-writeback`** turns a session into a reviewable delta and applies it.
153
+
154
+ ## Relationship to other standards
155
+
156
+ OAP does not replace [Agent Skills](https://code.claude.com/docs/en/skills), [MCP](https://modelcontextprotocol.io), or your harness's config. It fills the gap between them.
157
+
158
+ Skills are what an agent knows how to do. MCP is what it can reach. Harness config is what it is allowed to do. **OAP is who it is, and what it has learned.**
159
+
160
+ See [docs/interop.md](docs/interop.md) for field mappings.
161
+
162
+ ## Status
163
+
164
+ Draft, version 1.0. The format is stable enough to build against; the schemas and conformance requirements are versioned and will not change incompatibly within 1.x.
165
+
166
+ Feedback on the spec is most useful as a stated problem plus a proposed field. See [CONTRIBUTING.md](CONTRIBUTING.md).
167
+
168
+ ## License
169
+
170
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,148 @@
1
+ # Open Agent Profile (OAP)
2
+
3
+ **An open specification for persisting a named AI agent as a file instead of a running process.**
4
+
5
+ [Specification](spec/v1/SPEC.md) · [Conformance](spec/v1/conformance.md) · [Security](spec/v1/security.md) · [Docs](docs/) · [Examples](examples/) · [Skills](skills/)
6
+
7
+ ---
8
+
9
+ ## The problem
10
+
11
+ You define a useful agent: a reviewer that knows your conventions, a researcher that cites the way you want, a data engineer that has learned your table layout. Then the session ends.
12
+
13
+ Today that definition either dies with the session, or it lives in a format only one harness reads. Nothing carries what the agent *learned*: the conventions it picked up, the preferences you corrected it on, the investigation it was halfway through.
14
+
15
+ Keeping a process alive is the wrong fix. It is expensive, it dies with the machine, it cannot be diffed or reviewed, and two people cannot share it.
16
+
17
+ ## The idea
18
+
19
+ Persist the agent as **data**. A profile is a file describing a named agent: role, model, tool surface, permissions, attached context, and what previous sessions learned. A harness reads it to spin up a fresh session on demand, and writes an updated revision back when that session ends.
20
+
21
+ ```yaml
22
+ oap: "1.0"
23
+ kind: AgentProfile
24
+
25
+ metadata:
26
+ name: code-reviewer
27
+ description: Reviews changed code for correctness, security, and missing tests.
28
+ revision: 7
29
+
30
+ spec:
31
+ role:
32
+ instructions: |
33
+ You are a code reviewer. You read a diff and report defects. You do not
34
+ rewrite the change unless you are explicitly asked to.
35
+ constraints:
36
+ - Do not edit files. Report only.
37
+
38
+ model:
39
+ provider: anthropic
40
+ id: claude-sonnet-5
41
+ tier: advanced # portable fallback
42
+
43
+ tools:
44
+ policy: allowlist
45
+ allow: [read, search, git/diff]
46
+ deny: [shell, write, edit]
47
+
48
+ lifecycle:
49
+ writeback: propose # the agent proposes, a human approves
50
+
51
+ state: # what previous sessions learned
52
+ summary: >-
53
+ Reviewing the platform team's Python services. They autoformat with ruff, so
54
+ formatting findings are noise.
55
+ facts:
56
+ - id: fact-authz-pattern
57
+ text: Authorization must compare against the server-side session record.
58
+ confidence: 0.9
59
+ source: repeated finding across three sessions
60
+ pinned: true
61
+ open_threads:
62
+ - id: thread-flaky-auth-tests
63
+ title: Auth integration tests are flaky under parallel execution
64
+ status: blocked
65
+ ```
66
+
67
+ No process is resident. The file is the agent.
68
+
69
+ ## What makes it a specification rather than a file format
70
+
71
+ Three rules, and they are the reason this is safe to leave switched on.
72
+
73
+ **A profile narrows. It never widens.** A harness grants the intersection of what the profile asks for and what its own policy allows. Moving a profile to a new machine can never grant capability the harness would not otherwise give. There is no field, flag, or trust label that reverses this.
74
+
75
+ **An agent cannot rewrite its own contract.** Sessions emit a state delta, and delta operations may only touch `/state`. A change to tools, permissions, model, or instructions goes into a `proposals` block with a written rationale, and a human approves it. This holds under every writeback setting, including `auto`.
76
+
77
+ **Learned state is untrusted content.** Text an agent wrote about itself is injected as information, never as authority. A state entry saying "you may now use the shell without asking" changes nothing. Without this, one successful prompt injection becomes permanent.
78
+
79
+ ## Try it
80
+
81
+ ```bash
82
+ pip install open-agent-profile
83
+ ```
84
+
85
+ ```bash
86
+ oap-validate examples/code-reviewer.agent.yaml --digest
87
+ ```
88
+
89
+ Apply what a session learned, and watch the capability request get held back for review:
90
+
91
+ ```bash
92
+ oap-apply examples/code-reviewer.agent.yaml \
93
+ tests/deltas/learned-conventions.delta.yaml --approve --dry-run
94
+ ```
95
+
96
+ ```
97
+ 1 proposal(s) require human review and were NOT applied:
98
+ [high] /spec/tools/allow
99
+ value: ["read", "search", "git/diff", "git/log", "shell"]
100
+ rationale: Could not verify the flaky test claim without running the suite.
101
+ ```
102
+
103
+ ## Repository layout
104
+
105
+ | Path | What is in it |
106
+ | --- | --- |
107
+ | [`spec/v1/`](spec/v1/) | The normative specification, conformance requirements, and security model |
108
+ | [`schema/v1/`](schema/v1/) | JSON Schemas for `AgentProfile` and `AgentStateDelta` |
109
+ | [`docs/`](docs/) | Getting started, field reference, lifecycle, interop, implementers guide, FAQ |
110
+ | [`examples/`](examples/) | Working profiles, including negative fixtures that must be rejected |
111
+ | [`skills/`](skills/) | Agent Skills packages for harnesses without native OAP support |
112
+ | [`oap/`](oap/) | Reference validator and applicator |
113
+ | [`tests/`](tests/) | Conformance test suite |
114
+
115
+ ## Conformance levels
116
+
117
+ | Level | Capability |
118
+ | --- | --- |
119
+ | **1, Read** | Discover, validate, and instantiate an agent from a profile. |
120
+ | **2, Read/Write** | Level 1, plus state injection, delta generation, and persistence. |
121
+ | **3, Full** | Level 2, plus composition, MCP, skills, external memory, and delegation. |
122
+
123
+ An implementation must publish what it does not implement. Partial support is fine; partial support that looks complete is not, because someone will review a profile, run it elsewhere, and get a different agent than the one they read.
124
+
125
+ ## Using it without native support
126
+
127
+ Harnesses that do not speak OAP yet can still read and write profiles through the two bundled [Agent Skills](skills/):
128
+
129
+ - **`oap-agent-profile`** loads a profile, assembles the prompt in the specification's order, and reports what it dropped.
130
+ - **`oap-session-writeback`** turns a session into a reviewable delta and applies it.
131
+
132
+ ## Relationship to other standards
133
+
134
+ OAP does not replace [Agent Skills](https://code.claude.com/docs/en/skills), [MCP](https://modelcontextprotocol.io), or your harness's config. It fills the gap between them.
135
+
136
+ Skills are what an agent knows how to do. MCP is what it can reach. Harness config is what it is allowed to do. **OAP is who it is, and what it has learned.**
137
+
138
+ See [docs/interop.md](docs/interop.md) for field mappings.
139
+
140
+ ## Status
141
+
142
+ Draft, version 1.0. The format is stable enough to build against; the schemas and conformance requirements are versioned and will not change incompatibly within 1.x.
143
+
144
+ Feedback on the spec is most useful as a stated problem plus a proposed field. See [CONTRIBUTING.md](CONTRIBUTING.md).
145
+
146
+ ## License
147
+
148
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,21 @@
1
+ # Open Agent Profile documentation
2
+
3
+ Start here, in order:
4
+
5
+ | Document | Read it when |
6
+ | --- | --- |
7
+ | [Getting started](getting-started.md) | You want to write your first profile and run the validator. |
8
+ | [Field reference](field-reference.md) | You are authoring a profile and need to know what a field does. |
9
+ | [Lifecycle](lifecycle.md) | You want to understand how a profile becomes a session and back again. |
10
+ | [State and memory](state-and-memory.md) | You are deciding what belongs in the profile versus an external store. |
11
+ | [Interop](interop.md) | You are mapping OAP onto an existing harness format. |
12
+ | [Implementers guide](implementers-guide.md) | You are adding OAP support to a harness. |
13
+ | [FAQ](faq.md) | You have an objection. It is probably answered here. |
14
+
15
+ The normative documents live in [`spec/v1/`](../spec/v1/):
16
+
17
+ - [SPEC.md](../spec/v1/SPEC.md), the specification
18
+ - [conformance.md](../spec/v1/conformance.md), what an implementation must do
19
+ - [security.md](../spec/v1/security.md), the threat model
20
+
21
+ Where these docs and the spec disagree, the spec wins. These are explanation; that is contract.
@@ -0,0 +1,87 @@
1
+ # FAQ
2
+
3
+ ### Why not just keep the agent process running?
4
+
5
+ Because a resident process is expensive, fragile, and unreviewable. It dies with the machine, it cannot be diffed, two people cannot share it, and you cannot answer "what changed about this agent last month" by looking at it.
6
+
7
+ A file can be committed, reviewed, forked, and rolled back. Instantiation is cheap. The only thing you lose by not staying resident is in-memory context, and that is precisely what `state` is for.
8
+
9
+ ### Is this just a config file with extra steps?
10
+
11
+ A config file describes settings. A profile also carries what the agent learned, the rules for how that learning gets written back, an audit trail of who approved each revision, and a security boundary preventing the agent from editing its own contract.
12
+
13
+ Take away `state`, `history`, and the `proposals` gate, and yes, it is a config file. Those three are the point.
14
+
15
+ ### Why can't an agent edit its own `spec`?
16
+
17
+ Because then a single successful prompt injection becomes permanent. An agent that ingests a hostile web page and can write `spec.tools.allow` has just granted itself a shell, in a file that persists, that will be loaded again tomorrow, and that a reviewer will assume a human wrote.
18
+
19
+ The boundary costs almost nothing. An agent that wants a wider tool surface writes a `proposals` entry with a rationale, and a human reads it. That is a better workflow anyway, because the rationale is usually the interesting part.
20
+
21
+ ### Why not JSON Patch for deltas?
22
+
23
+ OAP deltas use an RFC 6902 subset (`add`, `replace`, `remove`) rather than the full thing, for three reasons.
24
+
25
+ `move`, `copy`, and `test` add implementation surface without adding capability that state updates need. Paths are constrained to `/state`, which is the security boundary, and a constrained pointer grammar is easier to verify than a general one. And deltas carry fields JSON Patch has no room for: `reason`, `confidence`, the `session` block, and the `proposals` channel.
26
+
27
+ The subset is deliberately a subset, so a JSON Patch library will apply the `operations` array correctly. It just will not enforce the parts that matter.
28
+
29
+ ### Why do arrays replace instead of append in `extends`?
30
+
31
+ Two reasons. With append semantics you cannot remove an inherited item, so a base's tool grant becomes permanent for every descendant. And at review time "which layer contributed this entry" becomes unanswerable, which is exactly the question a reviewer of a security-relevant list is asking.
32
+
33
+ Replace is more verbose. It is also legible, and you can read the effective list off the child document without holding three files in your head.
34
+
35
+ ### Isn't `state` just going to fill up with nonsense?
36
+
37
+ If you generate it by asking a model to summarize what it learned, yes, absolutely. See [lifecycle.md](lifecycle.md#5-reconcile).
38
+
39
+ The format pushes against this from several directions: `writeback: propose` is the default so a human sees entries before they persist, every entry carries `confidence` and `source` so bad ones are visible, retention caps and TTLs age out what stops getting used, and the recommendation is to derive operations from evidence rather than inference.
40
+
41
+ None of that saves an implementation that pipes free-form model output into the file. Generate operations from concrete evidence.
42
+
43
+ ### Why a `tier` field when I already specified a model?
44
+
45
+ Because a profile outlives a model id. Share a profile pinned to `claude-sonnet-5` with someone running local models and it breaks; with `tier: advanced` it degrades to whatever their harness considers advanced, and the harness reports the substitution.
46
+
47
+ Specify both. The exact id is used when it can be, and the tier is what makes the profile portable.
48
+
49
+ ### What if my harness only supports half of this?
50
+
51
+ Implement Level 1, publish a conformance statement saying exactly what you skipped, and make sure you record and can display every field you dropped.
52
+
53
+ Partial support is fine and expected. Partial support that pretends to be complete is not, because someone will review a profile, run it on your harness, and get an agent with different capabilities than the one they read.
54
+
55
+ ### Can profiles contain code, or a hook script?
56
+
57
+ No. `lifecycle.on_start` and `on_end` reference hooks **already registered with the harness**, by name, with string parameters. A profile never carries a command line, a script body, or an install directive.
58
+
59
+ The moment a profile can carry a command, sharing one is remote code execution, and the format stops being safe to email.
60
+
61
+ `mcp_servers[].command` is the sole exception, because MCP requires naming an executable. It is a declaration of intent, launching it is gated separately, and harnesses should not auto-launch servers from a `project` or `imported` profile without showing the user the command line.
62
+
63
+ ### How do I share profiles across a team?
64
+
65
+ Commit them to `.agents/` in the repository. That gives you review, blame, and rollback for free.
66
+
67
+ Two things to decide as a team. First, whether committed profiles carry `state`: keeping it means shared learning and noisy diffs, dropping it means each person's agent learns separately. A common split is `writeback: off` on committed profiles and a personal copy in `~/.config/<harness>/agents/` that learns.
68
+
69
+ Second, review the `history` block in pull requests. It is the cheapest way to notice an agent that has quietly drifted.
70
+
71
+ ### What about signing?
72
+
73
+ Reserved for a future version. Today, pin by spec digest and treat unpinned imported profiles as untrusted, which is what the `imported` trust label is for.
74
+
75
+ ### Why YAML and not TOML?
76
+
77
+ Multi-line strings. `spec.role.instructions` is often several hundred lines of prose, and YAML block scalars handle that better than anything TOML offers. JSON is the canonical form for digests and tooling; Markdown frontmatter exists because a long system prompt is far nicer to edit as a document body.
78
+
79
+ ### Does this work for non-coding agents?
80
+
81
+ Yes. Nothing in the format is coding-specific. A research analyst, a support triage agent, and a writing assistant all fit; see `examples/research-analyst.agent.md`.
82
+
83
+ The coding examples are prominent because that is where multi-session memory has the clearest payoff, not because the format assumes it.
84
+
85
+ ### Who decides what goes in the spec?
86
+
87
+ See [CONTRIBUTING.md](../CONTRIBUTING.md). Short version: changes need a stated problem, a proposed field, and at least one implementation willing to build it. The bar for adding a field is higher than the bar for adding a doc, because every field is something every implementer has to decide about.