Skip to content

Commit cc4048d

Browse files
committed
Polish repo, docs, and local demo
1 parent 6c3f856 commit cc4048d

16 files changed

Lines changed: 1219 additions & 34 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Bug report
2+
description: Report a reproducible defect in agentproof
3+
title: "[bug] "
4+
labels: ["bug"]
5+
body:
6+
- type: textarea
7+
id: summary
8+
attributes:
9+
label: Summary
10+
description: What happened and what did you expect instead?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: reproduction
15+
attributes:
16+
label: Reproduction
17+
description: Provide minimal code, inputs, or steps.
18+
render: python
19+
validations:
20+
required: true
21+
- type: input
22+
id: version
23+
attributes:
24+
label: agentproof version
25+
placeholder: 0.1.0
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: environment
30+
attributes:
31+
label: Environment
32+
description: Python version, OS, and any relevant framework/runtime details.
33+

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security issue
4+
url: https://github.com/bnovik0v/agentproof/security
5+
about: Report security issues privately through GitHub Security Advisories.
6+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature request
2+
description: Propose a new capability or change for agentproof
3+
title: "[feature] "
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
description: What problem are you trying to solve?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposal
17+
description: Describe the interface or behavior you want.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Alternatives
24+
description: What alternatives did you consider?
25+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Summary
2+
3+
Describe the user-visible change and the reasoning behind it.
4+
5+
## Checks
6+
7+
- [ ] Added or updated tests
8+
- [ ] Updated docs or README if behavior changed
9+
- [ ] Ran `uv run ruff check .`
10+
- [ ] Ran `uv run mypy .`
11+
- [ ] Ran `uv run pytest`
12+

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
id-token: write
4343
environment:
4444
name: pypi
45-
url: https://pypi.org/p/agentproof
45+
url: https://pypi.org/p/agentproof-ai
4646
steps:
4747
- name: Download distributions
4848
uses: actions/download-artifact@v4
@@ -70,4 +70,3 @@ jobs:
7070
env:
7171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7272
run: gh release create "${GITHUB_REF_NAME}" dist/*
73-

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
## 0.1.0 - 2026-03-06
44

55
- Initial release candidate for the `agentproof` library
6+
- Published distribution name is `agentproof-ai`
67
- Added `proof_of_work` and `semantic_math_lock` challenge families
78
- Added CLI, tests, docs, and GitHub workflows
8-

CITATION.cff

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cff-version: 1.2.0
2+
title: agentproof
3+
message: If you use this project, please cite the repository.
4+
type: software
5+
authors:
6+
- family-names: Novikov
7+
given-names: Borislav
8+
email: bnovikov012@gmail.com
9+
repository-code: https://github.com/bnovik0v/agentproof
10+
license: MIT

README.md

Lines changed: 171 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,85 @@
11
# agentproof
22

3+
![Distribution](https://img.shields.io/badge/distribution-agentproof--ai-0f766e)
4+
![Python](https://img.shields.io/badge/python-3.10%20to%203.13-1f6feb)
5+
![CI](https://github.com/bnovik0v/agentproof/actions/workflows/ci.yml/badge.svg)
6+
![Docs](https://github.com/bnovik0v/agentproof/actions/workflows/docs.yml/badge.svg)
7+
[![License](https://img.shields.io/github/license/bnovik0v/agentproof)](LICENSE)
8+
9+
![agentproof overview](assets/agentproof-hero.svg)
10+
311
`agentproof` is an open-source Python library for agent-oriented verification challenges.
4-
It helps applications issue deterministic, machine-checkable challenges that are easier for
5-
programmatic agents to solve than for humans to complete manually.
12+
It gives Python services a clean way to issue deterministic, machine-checkable challenges that
13+
are easier for programmatic agents to solve than for humans to complete manually.
614

715
The library does not claim cryptographic proof of model provenance. It focuses on a narrower,
816
defensible goal: structured challenge-response verification.
917

18+
## Why this exists
19+
20+
Traditional CAPTCHA systems try to separate humans from bots. `agentproof` flips that framing:
21+
it helps you design challenge-response checks that favor capable software agents and remain
22+
verifiable on the server.
23+
24+
This is useful when you want to:
25+
26+
- gate access to agent-focused endpoints
27+
- experiment with reverse-CAPTCHA style flows
28+
- add a deterministic challenge layer to evaluation or abuse-control pipelines
29+
- prototype agent-friendly verification without inventing your own format from scratch
30+
31+
## Design goals
32+
33+
- Keep verification deterministic and easy to reason about
34+
- Make payloads JSON-friendly for APIs and job systems
35+
- Keep the public API narrow and typed
36+
- Document the threat model instead of overselling the guarantees
37+
- Stay lightweight enough for experiments and production prototypes
38+
1039
## Features
1140

12-
- Typed Python API
13-
- Deterministic challenge generation and verification
14-
- Pluggable challenge families
15-
- Reference CLI for local demos and integration tests
16-
- Testable JSON payloads for web APIs and backend services
41+
- Typed Python API with a small public surface
42+
- Deterministic challenge generation, solving, and verification
43+
- Pluggable challenge families behind a shared protocol
44+
- JSON-serializable payloads for APIs, queues, and services
45+
- Reference CLI for demos and integration tests
46+
- Built-in documentation, examples, CI, and release automation
1747

18-
## Included challenge families
48+
## Challenge families
1949

20-
- `proof_of_work`: a hashcash-style puzzle
21-
- `semantic_math_lock`: a human-readable text challenge with exact measurable constraints
50+
| Challenge type | Purpose | Verification style |
51+
| --- | --- | --- |
52+
| `proof_of_work` | Add deterministic compute cost | Leading-zero SHA256 check |
53+
| `semantic_math_lock` | Favor structured text generation | Exact word constraints and ASCII initial sum |
2254

2355
## Installation
2456

2557
```bash
26-
pip install agentproof
58+
pip install agentproof-ai
59+
```
60+
61+
The published distribution name is `agentproof-ai`, while the import remains `agentproof`:
62+
63+
```python
64+
import agentproof
2765
```
2866

2967
For local development:
3068

3169
```bash
32-
python -m venv .venv
33-
source .venv/bin/activate
34-
pip install -e ".[dev,docs]"
70+
uv sync --extra dev --extra docs --extra demo
71+
```
72+
73+
## Public API
74+
75+
```python
76+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
3577
```
3678

3779
## Quickstart
3880

3981
```python
40-
from agentproof import AgentResponse, ChallengeSpec, generate_challenge, solve_challenge, verify_response
82+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
4183

4284
spec = ChallengeSpec(challenge_type="proof_of_work", difficulty=18, ttl_seconds=120)
4385
challenge = generate_challenge(spec)
@@ -47,6 +89,79 @@ result = verify_response(challenge, response)
4789
assert result.ok
4890
```
4991

92+
### Example output
93+
94+
```json
95+
{
96+
"ok": true,
97+
"reason": "ok",
98+
"details": {
99+
"hash": "0007f5...",
100+
"nonce": "18423"
101+
}
102+
}
103+
```
104+
105+
### Semantic challenge example
106+
107+
```python
108+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
109+
110+
challenge = generate_challenge(
111+
ChallengeSpec(
112+
challenge_type="semantic_math_lock",
113+
ttl_seconds=90,
114+
options={"topic": "security", "word_count": 7},
115+
)
116+
)
117+
response = solve_challenge(challenge)
118+
result = verify_response(challenge, response)
119+
120+
assert result.ok
121+
print(response.payload["text"])
122+
```
123+
124+
### Service integration example
125+
126+
```python
127+
from agentproof import AgentResponse, Challenge, ChallengeSpec, generate_challenge, verify_response
128+
129+
challenge = generate_challenge(
130+
ChallengeSpec(challenge_type="semantic_math_lock", options={"topic": "security", "word_count": 7})
131+
)
132+
133+
# ... send challenge.to_dict() to a client ...
134+
135+
response = AgentResponse(
136+
challenge_id=challenge.challenge_id,
137+
challenge_type=challenge.challenge_type,
138+
payload={"text": "security demands careful metrics metrics metrics metrics"},
139+
)
140+
141+
result = verify_response(challenge, response)
142+
```
143+
144+
### CLI roundtrip
145+
146+
```bash
147+
agentproof generate proof_of_work --difficulty 16 --output challenge.json
148+
agentproof solve challenge.json --output response.json
149+
agentproof verify challenge.json response.json
150+
```
151+
152+
## Verification model
153+
154+
```mermaid
155+
sequenceDiagram
156+
participant S as Service
157+
participant A as Agent client
158+
S->>A: Issue challenge JSON
159+
A->>A: Solve challenge
160+
A->>S: Submit structured response
161+
S->>S: Verify deterministically
162+
S-->>A: Accept or reject
163+
```
164+
50165
## CLI
51166

52167
Generate a challenge:
@@ -67,23 +182,58 @@ Verify a response:
67182
agentproof verify challenge.json response.json
68183
```
69184

185+
## Demo project
186+
187+
A runnable local demo lives in [`demo/`](/home/borislav/VSCode/agentproof/demo). It is intended
188+
for opening in VSCode and trying the package end-to-end with a small UI and example service flow.
189+
190+
## Threat model
191+
192+
`agentproof` helps with agent-oriented challenge-response flows. It does **not** prove:
193+
194+
- model provenance
195+
- provider identity
196+
- hardware-backed execution
197+
- immunity against determined scripted attackers
198+
199+
Use it as one verification signal, not as a complete trust system.
200+
70201
## Security and scope
71202

72203
`agentproof` is not an identity or attestation system. It does not prove that a request came
73204
from a specific model provider or hardware-backed agent. The current scope is challenge-response
74205
verification with explicit tradeoffs documented in the threat model.
75206

207+
## Modern repo defaults
208+
209+
- GitHub Actions CI across Python 3.10 to 3.13
210+
- Typed package with `py.typed`
211+
- Coverage gate at 90%+
212+
- MkDocs documentation site
213+
- Dependabot config and issue templates
214+
- PyPI release workflow prepared for trusted publishing
215+
76216
## Development
77217

78218
```bash
79-
ruff check .
80-
ruff format --check .
81-
mypy .
82-
pytest
83-
python -m build
219+
uv run ruff check .
220+
uv run mypy .
221+
uv run pytest
222+
uv run python -m build
223+
uv run mkdocs build --strict
84224
```
85225

226+
## Release model
227+
228+
- `main` runs lint, type checks, tests, package builds, and docs builds in GitHub Actions
229+
- version tags trigger package publishing through the release workflow
230+
- PyPI publishing is configured for trusted publishing, so the repository should be linked to the
231+
target PyPI project before pushing a release tag
232+
233+
## Contributing
234+
235+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup and quality checks.
236+
86237
## License
87238

88239
MIT
89-

SECURITY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ authentication or anti-fraud decisions.
99
## Reporting
1010

1111
Report vulnerabilities privately through GitHub security advisories or direct
12-
maintainer contact before public disclosure.
12+
maintainer contact at `bnovikov012@gmail.com` before public disclosure.
1313

1414
## Supported versions
1515

1616
Only the latest minor release is supported for security fixes.
17-

0 commit comments

Comments
 (0)