agent-alignment-protocol 0.4.0__tar.gz → 1.3.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.
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/.gitignore +2 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/PKG-INFO +3 -3
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/README.md +2 -2
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/pyproject.toml +8 -1
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/schemas/alignment-card.schema.json +2 -2
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/__init__.py +1 -1
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/cli/main.py +2 -2
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/__init__.py +2 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/alignment_card.py +2 -2
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/ap_trace.py +28 -1
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/LICENSE +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/schemas/ap-trace.schema.json +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/schemas/value-coherence.schema.json +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/cli/__init__.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/compliance.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/py.typed +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/value_coherence.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/tracing.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/__init__.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/api.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/constants.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/divergence.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/features.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/models.py +0 -0
- {agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/ssm.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-alignment-protocol
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Agent Alignment Protocol - The missing alignment layer for the agent protocol stack
|
|
5
5
|
Project-URL: Homepage, https://github.com/mnemom/aap
|
|
6
6
|
Project-URL: Documentation, https://github.com/mnemom/aap#readme
|
|
@@ -46,7 +46,7 @@ Description-Content-Type: text/markdown
|
|
|
46
46
|
[](https://pypi.org/project/agent-alignment-protocol/)
|
|
47
47
|
[](https://www.npmjs.com/package/@mnemom/agent-alignment-protocol)
|
|
48
48
|
[](LICENSE)
|
|
49
|
-
[](https://docs.mnemom.ai/protocols/aap/specification)
|
|
50
50
|
|
|
51
51
|
**A transparency protocol for autonomous agents.**
|
|
52
52
|
|
|
@@ -115,7 +115,7 @@ A structured declaration of an agent's alignment posture:
|
|
|
115
115
|
|
|
116
116
|
```json
|
|
117
117
|
{
|
|
118
|
-
"aap_version": "
|
|
118
|
+
"aap_version": "1.0.0",
|
|
119
119
|
"agent_id": "did:web:my-agent.example.com",
|
|
120
120
|
"principal": {
|
|
121
121
|
"type": "human",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://pypi.org/project/agent-alignment-protocol/)
|
|
7
7
|
[](https://www.npmjs.com/package/@mnemom/agent-alignment-protocol)
|
|
8
8
|
[](LICENSE)
|
|
9
|
-
[](https://docs.mnemom.ai/protocols/aap/specification)
|
|
10
10
|
|
|
11
11
|
**A transparency protocol for autonomous agents.**
|
|
12
12
|
|
|
@@ -75,7 +75,7 @@ A structured declaration of an agent's alignment posture:
|
|
|
75
75
|
|
|
76
76
|
```json
|
|
77
77
|
{
|
|
78
|
-
"aap_version": "
|
|
78
|
+
"aap_version": "1.0.0",
|
|
79
79
|
"agent_id": "did:web:my-agent.example.com",
|
|
80
80
|
"principal": {
|
|
81
81
|
"type": "human",
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agent-alignment-protocol"
|
|
7
|
-
version = "
|
|
7
|
+
version = "1.3.0"
|
|
8
8
|
description = "Agent Alignment Protocol - The missing alignment layer for the agent protocol stack"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -101,3 +101,10 @@ warn_unused_ignores = true
|
|
|
101
101
|
[tool.pytest.ini_options]
|
|
102
102
|
testpaths = ["tests"]
|
|
103
103
|
asyncio_mode = "auto"
|
|
104
|
+
addopts = "--cov=src/aap --cov-report=xml --cov-report=term-missing"
|
|
105
|
+
|
|
106
|
+
[tool.coverage.run]
|
|
107
|
+
source = ["src/aap"]
|
|
108
|
+
|
|
109
|
+
[tool.coverage.report]
|
|
110
|
+
show_missing = true
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/schemas/alignment-card.schema.json
RENAMED
|
@@ -390,10 +390,10 @@
|
|
|
390
390
|
"type": "object"
|
|
391
391
|
}
|
|
392
392
|
},
|
|
393
|
-
"description": "Alignment Card \u2014 Agent alignment declaration (SPEC Section 4).\n\nA structured document declaring an agent's alignment posture. It MUST be\nmachine-readable (JSON) and SHOULD be human-readable.\n\nExample:\n card = AlignmentCard(\n aap_version=\"0.
|
|
393
|
+
"description": "Alignment Card \u2014 Agent alignment declaration (SPEC Section 4).\n\nA structured document declaring an agent's alignment posture. It MUST be\nmachine-readable (JSON) and SHOULD be human-readable.\n\nExample:\n card = AlignmentCard(\n aap_version=\"0.5.0\",\n card_id=\"ac-12345\",\n agent_id=\"did:web:agent.example.com\",\n issued_at=datetime.utcnow(),\n principal=Principal(type=PrincipalType.HUMAN, relationship=RelationshipType.DELEGATED_AUTHORITY),\n values=Values(declared=[\"principal_benefit\", \"transparency\"]),\n autonomy_envelope=AutonomyEnvelope(\n bounded_actions=[\"search\", \"recommend\"],\n escalation_triggers=[\n EscalationTrigger(\n condition='action_type == \"purchase\"',\n action=TriggerAction.ESCALATE,\n reason=\"Purchases require approval\",\n )\n ],\n ),\n audit_commitment=AuditCommitment(\n retention_days=90,\n queryable=True,\n query_endpoint=\"https://agent.example.com/api/traces\",\n ),\n )",
|
|
394
394
|
"properties": {
|
|
395
395
|
"aap_version": {
|
|
396
|
-
"default": "0.
|
|
396
|
+
"default": "0.5.0",
|
|
397
397
|
"description": "AAP specification version",
|
|
398
398
|
"title": "Aap Version",
|
|
399
399
|
"type": "string"
|
|
@@ -196,7 +196,7 @@ def _create_card_from_values(
|
|
|
196
196
|
"""Create a minimal Alignment Card from a list of values."""
|
|
197
197
|
now = datetime.now(timezone.utc)
|
|
198
198
|
return {
|
|
199
|
-
"aap_version": "0.
|
|
199
|
+
"aap_version": "0.5.0",
|
|
200
200
|
"card_id": card_id or f"ac-{uuid.uuid4().hex[:12]}",
|
|
201
201
|
"agent_id": agent_id or f"agent-{uuid.uuid4().hex[:8]}",
|
|
202
202
|
"issued_at": now.isoformat(),
|
|
@@ -291,7 +291,7 @@ def _create_card_interactive(agent_id: str | None = None, card_id: str | None =
|
|
|
291
291
|
|
|
292
292
|
now = datetime.now(timezone.utc)
|
|
293
293
|
return {
|
|
294
|
-
"aap_version": "0.
|
|
294
|
+
"aap_version": "0.5.0",
|
|
295
295
|
"card_id": card_id or f"ac-{uuid.uuid4().hex[:12]}",
|
|
296
296
|
"agent_id": agent_id or f"agent-{uuid.uuid4().hex[:8]}",
|
|
297
297
|
"issued_at": now.isoformat(),
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/__init__.py
RENAMED
|
@@ -61,6 +61,7 @@ from aap.schemas.ap_trace import (
|
|
|
61
61
|
PrincipalResponse,
|
|
62
62
|
TraceContext,
|
|
63
63
|
TriggerCheck,
|
|
64
|
+
ValueScore,
|
|
64
65
|
)
|
|
65
66
|
from aap.schemas.value_coherence import (
|
|
66
67
|
AlignmentCardRequest,
|
|
@@ -109,6 +110,7 @@ __all__ = [
|
|
|
109
110
|
"TriggerCheck",
|
|
110
111
|
"PrincipalResponse",
|
|
111
112
|
"TraceContext",
|
|
113
|
+
"ValueScore",
|
|
112
114
|
# Value Coherence (SPEC Section 6)
|
|
113
115
|
"AlignmentCardRequest",
|
|
114
116
|
"AlignmentCardResponse",
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/alignment_card.py
RENAMED
|
@@ -223,7 +223,7 @@ class AlignmentCard(BaseModel):
|
|
|
223
223
|
|
|
224
224
|
Example:
|
|
225
225
|
card = AlignmentCard(
|
|
226
|
-
aap_version="0.
|
|
226
|
+
aap_version="0.5.0",
|
|
227
227
|
card_id="ac-12345",
|
|
228
228
|
agent_id="did:web:agent.example.com",
|
|
229
229
|
issued_at=datetime.utcnow(),
|
|
@@ -248,7 +248,7 @@ class AlignmentCard(BaseModel):
|
|
|
248
248
|
"""
|
|
249
249
|
|
|
250
250
|
aap_version: str = Field(
|
|
251
|
-
default="0.
|
|
251
|
+
default="0.5.0", description="AAP specification version"
|
|
252
252
|
)
|
|
253
253
|
card_id: str = Field(
|
|
254
254
|
..., description="Unique identifier for this card (UUID or URI)"
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/ap_trace.py
RENAMED
|
@@ -14,7 +14,7 @@ from __future__ import annotations
|
|
|
14
14
|
|
|
15
15
|
from datetime import datetime
|
|
16
16
|
from enum import Enum
|
|
17
|
-
from typing import Any
|
|
17
|
+
from typing import Any, Literal
|
|
18
18
|
|
|
19
19
|
from pydantic import BaseModel, Field, model_validator
|
|
20
20
|
|
|
@@ -87,6 +87,21 @@ class Alternative(BaseModel):
|
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
+
class ValueScore(BaseModel):
|
|
91
|
+
"""Per-value score from V2 observer scoring (Phase 3.3)."""
|
|
92
|
+
|
|
93
|
+
score: Literal["on_track", "off_track", "not_applicable"] = Field(
|
|
94
|
+
..., description="Score against the catalog entry's observer_signals rubric"
|
|
95
|
+
)
|
|
96
|
+
rationale: str = Field(
|
|
97
|
+
...,
|
|
98
|
+
description=(
|
|
99
|
+
"Free-form rationale citing one of the catalog "
|
|
100
|
+
"observer_signals patterns"
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
90
105
|
class Decision(BaseModel):
|
|
91
106
|
"""Decision process record (SPEC Section 5.5)."""
|
|
92
107
|
|
|
@@ -105,6 +120,18 @@ class Decision(BaseModel):
|
|
|
105
120
|
confidence: float | None = Field(
|
|
106
121
|
None, ge=0.0, le=1.0, description="Decision confidence"
|
|
107
122
|
)
|
|
123
|
+
value_scores: dict[str, ValueScore] | None = Field(
|
|
124
|
+
None,
|
|
125
|
+
description=(
|
|
126
|
+
"Per-declared-value score against the alignment card's catalog "
|
|
127
|
+
"observer_signals (Phase 3.3 V2 observer surface). Optional — "
|
|
128
|
+
"present when the card declares catalog values with "
|
|
129
|
+
"observer_signals defined; absent on V1 observer output. Keyed "
|
|
130
|
+
"by catalog value id. `values_applied` is derived from "
|
|
131
|
+
"`value_scores` entries whose score is 'on_track' to preserve "
|
|
132
|
+
"the V1 surface contract for downstream consumers."
|
|
133
|
+
),
|
|
134
|
+
)
|
|
108
135
|
|
|
109
136
|
@model_validator(mode="after")
|
|
110
137
|
def selected_must_be_in_alternatives(self) -> Decision:
|
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/schemas/ap-trace.schema.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/schemas/value_coherence.py
RENAMED
|
File without changes
|
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/__init__.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/api.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/constants.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/divergence.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/features.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/models.py
RENAMED
|
File without changes
|
{agent_alignment_protocol-0.4.0 → agent_alignment_protocol-1.3.0}/src/aap/verification/ssm.py
RENAMED
|
File without changes
|