agentproof-ai 0.1.1__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.
- agentproof_ai-0.1.1/.editorconfig +13 -0
- agentproof_ai-0.1.1/.github/ISSUE_TEMPLATE/bug_report.yml +33 -0
- agentproof_ai-0.1.1/.github/ISSUE_TEMPLATE/config.yml +6 -0
- agentproof_ai-0.1.1/.github/ISSUE_TEMPLATE/feature_request.yml +25 -0
- agentproof_ai-0.1.1/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- agentproof_ai-0.1.1/.github/dependabot.yml +14 -0
- agentproof_ai-0.1.1/.github/workflows/ci.yml +66 -0
- agentproof_ai-0.1.1/.github/workflows/docs.yml +56 -0
- agentproof_ai-0.1.1/.github/workflows/release.yml +75 -0
- agentproof_ai-0.1.1/.gitignore +12 -0
- agentproof_ai-0.1.1/.pre-commit-config.yaml +7 -0
- agentproof_ai-0.1.1/CHANGELOG.md +14 -0
- agentproof_ai-0.1.1/CITATION.cff +10 -0
- agentproof_ai-0.1.1/CODE_OF_CONDUCT.md +10 -0
- agentproof_ai-0.1.1/CONTRIBUTING.md +27 -0
- agentproof_ai-0.1.1/LICENSE +22 -0
- agentproof_ai-0.1.1/PKG-INFO +278 -0
- agentproof_ai-0.1.1/README.md +239 -0
- agentproof_ai-0.1.1/SECURITY.md +16 -0
- agentproof_ai-0.1.1/assets/agentproof-hero.svg +34 -0
- agentproof_ai-0.1.1/demo/README.md +40 -0
- agentproof_ai-0.1.1/demo/__init__.py +2 -0
- agentproof_ai-0.1.1/demo/app.py +540 -0
- agentproof_ai-0.1.1/docs/api.md +22 -0
- agentproof_ai-0.1.1/docs/concepts.md +23 -0
- agentproof_ai-0.1.1/docs/examples.md +27 -0
- agentproof_ai-0.1.1/docs/index.md +13 -0
- agentproof_ai-0.1.1/docs/threat-model.md +19 -0
- agentproof_ai-0.1.1/examples/roundtrip_cli.py +15 -0
- agentproof_ai-0.1.1/examples/service_flow.py +23 -0
- agentproof_ai-0.1.1/idea-draft.md +675 -0
- agentproof_ai-0.1.1/mkdocs.yml +11 -0
- agentproof_ai-0.1.1/pyproject.toml +97 -0
- agentproof_ai-0.1.1/src/agentproof/__init__.py +15 -0
- agentproof_ai-0.1.1/src/agentproof/__main__.py +4 -0
- agentproof_ai-0.1.1/src/agentproof/api.py +23 -0
- agentproof_ai-0.1.1/src/agentproof/challenges/__init__.py +27 -0
- agentproof_ai-0.1.1/src/agentproof/challenges/base.py +21 -0
- agentproof_ai-0.1.1/src/agentproof/challenges/proof_of_work.py +87 -0
- agentproof_ai-0.1.1/src/agentproof/challenges/semantic_math.py +155 -0
- agentproof_ai-0.1.1/src/agentproof/cli.py +92 -0
- agentproof_ai-0.1.1/src/agentproof/exceptions.py +18 -0
- agentproof_ai-0.1.1/src/agentproof/models.py +113 -0
- agentproof_ai-0.1.1/src/agentproof/py.typed +1 -0
- agentproof_ai-0.1.1/src/agentproof/utils/__init__.py +2 -0
- agentproof_ai-0.1.1/src/agentproof/utils/hashing.py +17 -0
- agentproof_ai-0.1.1/src/agentproof/utils/normalization.py +16 -0
- agentproof_ai-0.1.1/tests/test_api.py +108 -0
- agentproof_ai-0.1.1/tests/test_cli.py +67 -0
- agentproof_ai-0.1.1/tests/test_demo_app.py +62 -0
- agentproof_ai-0.1.1/tests/test_models.py +21 -0
- agentproof_ai-0.1.1/uv.lock +1310 -0
|
@@ -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
|
+
|
|
@@ -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
|
+
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: "github-actions"
|
|
10
|
+
directory: "/"
|
|
11
|
+
schedule:
|
|
12
|
+
interval: "weekly"
|
|
13
|
+
open-pull-requests-limit: 10
|
|
14
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
quality:
|
|
11
|
+
name: Quality
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Check out repository
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: |
|
|
24
|
+
python -m pip install --upgrade pip
|
|
25
|
+
python -m pip install -e ".[dev,docs]"
|
|
26
|
+
|
|
27
|
+
- name: Run Ruff
|
|
28
|
+
run: python -m ruff check .
|
|
29
|
+
|
|
30
|
+
- name: Run Mypy
|
|
31
|
+
run: python -m mypy .
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: python -m pytest
|
|
35
|
+
|
|
36
|
+
- name: Build package
|
|
37
|
+
run: python -m build
|
|
38
|
+
|
|
39
|
+
- name: Build docs
|
|
40
|
+
run: python -m mkdocs build --strict
|
|
41
|
+
|
|
42
|
+
test-matrix:
|
|
43
|
+
name: Tests (${{ matrix.os }}, py${{ matrix.python-version }})
|
|
44
|
+
runs-on: ${{ matrix.os }}
|
|
45
|
+
strategy:
|
|
46
|
+
fail-fast: false
|
|
47
|
+
matrix:
|
|
48
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
49
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
50
|
+
steps:
|
|
51
|
+
- name: Check out repository
|
|
52
|
+
uses: actions/checkout@v4
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ matrix.python-version }}
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: |
|
|
61
|
+
python -m pip install --upgrade pip
|
|
62
|
+
python -m pip install -e ".[dev]"
|
|
63
|
+
|
|
64
|
+
- name: Run tests
|
|
65
|
+
run: python -m pytest
|
|
66
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Check out repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
python -m pip install -e ".[docs]"
|
|
34
|
+
|
|
35
|
+
- name: Configure Pages
|
|
36
|
+
uses: actions/configure-pages@v5
|
|
37
|
+
|
|
38
|
+
- name: Build docs
|
|
39
|
+
run: python -m mkdocs build --strict
|
|
40
|
+
|
|
41
|
+
- name: Upload Pages artifact
|
|
42
|
+
uses: actions/upload-pages-artifact@v3
|
|
43
|
+
with:
|
|
44
|
+
path: site/
|
|
45
|
+
|
|
46
|
+
deploy:
|
|
47
|
+
environment:
|
|
48
|
+
name: github-pages
|
|
49
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
needs: build
|
|
52
|
+
steps:
|
|
53
|
+
- name: Deploy to GitHub Pages
|
|
54
|
+
id: deployment
|
|
55
|
+
uses: actions/deploy-pages@v4
|
|
56
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Build distributions
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
|
|
23
|
+
- name: Install build tooling
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
python -m pip install build
|
|
27
|
+
|
|
28
|
+
- name: Build distributions
|
|
29
|
+
run: python -m build
|
|
30
|
+
|
|
31
|
+
- name: Upload distributions
|
|
32
|
+
uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: python-package-distributions
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
publish:
|
|
38
|
+
name: Publish to PyPI
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
needs: build
|
|
41
|
+
permissions:
|
|
42
|
+
id-token: write
|
|
43
|
+
environment:
|
|
44
|
+
name: pypi
|
|
45
|
+
url: https://pypi.org/p/agentproof-ai
|
|
46
|
+
steps:
|
|
47
|
+
- name: Download distributions
|
|
48
|
+
uses: actions/download-artifact@v4
|
|
49
|
+
with:
|
|
50
|
+
name: python-package-distributions
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
- name: Publish distributions to PyPI
|
|
54
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
55
|
+
|
|
56
|
+
github-release:
|
|
57
|
+
name: Create GitHub release
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs: build
|
|
60
|
+
permissions:
|
|
61
|
+
contents: write
|
|
62
|
+
steps:
|
|
63
|
+
- name: Check out repository
|
|
64
|
+
uses: actions/checkout@v4
|
|
65
|
+
|
|
66
|
+
- name: Download distributions
|
|
67
|
+
uses: actions/download-artifact@v4
|
|
68
|
+
with:
|
|
69
|
+
name: python-package-distributions
|
|
70
|
+
path: dist/
|
|
71
|
+
|
|
72
|
+
- name: Create release
|
|
73
|
+
env:
|
|
74
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
75
|
+
run: gh release create "${GITHUB_REF_NAME}" dist/*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1 - 2026-03-06
|
|
4
|
+
|
|
5
|
+
- Fixed GitHub release creation workflow by checking out the repository before invoking `gh release`
|
|
6
|
+
- Polished README, repository metadata, issue templates, and demo project
|
|
7
|
+
- Added an automated integration test for the local demo app
|
|
8
|
+
|
|
9
|
+
## 0.1.0 - 2026-03-06
|
|
10
|
+
|
|
11
|
+
- Initial release candidate for the `agentproof` library
|
|
12
|
+
- Published distribution name is `agentproof-ai`
|
|
13
|
+
- Added `proof_of_work` and `semantic_math_lock` challenge families
|
|
14
|
+
- Added CLI, tests, docs, and GitHub workflows
|
|
@@ -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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project follows a simple standard: be respectful, direct, and constructive.
|
|
4
|
+
|
|
5
|
+
Unacceptable behavior includes harassment, personal attacks, deliberate disruption,
|
|
6
|
+
and publishing private information without consent.
|
|
7
|
+
|
|
8
|
+
Project maintainers may remove comments, commits, or contributions that do not meet
|
|
9
|
+
this standard.
|
|
10
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
python -m venv .venv
|
|
7
|
+
source .venv/bin/activate
|
|
8
|
+
pip install -e ".[dev,docs]"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quality checks
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ruff check .
|
|
15
|
+
ruff format .
|
|
16
|
+
mypy .
|
|
17
|
+
pytest
|
|
18
|
+
python -m build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Pull requests
|
|
22
|
+
|
|
23
|
+
- Keep the public API typed and documented
|
|
24
|
+
- Add tests for every behavior change
|
|
25
|
+
- Update docs and changelog for user-facing changes
|
|
26
|
+
- Prefer deterministic verification logic over heuristic checks
|
|
27
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Borislav
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentproof-ai
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Agent-oriented verification challenges for Python applications.
|
|
5
|
+
Project-URL: Homepage, https://github.com/bnovik0v/agentproof
|
|
6
|
+
Project-URL: Documentation, https://bnovik0v.github.io/agentproof/
|
|
7
|
+
Project-URL: Issues, https://github.com/bnovik0v/agentproof/issues
|
|
8
|
+
Project-URL: Source, https://github.com/bnovik0v/agentproof
|
|
9
|
+
Author-email: Borislav <bnovikov012@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent,ai,captcha,challenge-response,verification
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Internet
|
|
22
|
+
Classifier: Topic :: Security
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Provides-Extra: demo
|
|
26
|
+
Requires-Dist: fastapi>=0.115; extra == 'demo'
|
|
27
|
+
Requires-Dist: httpx>=0.28; extra == 'demo'
|
|
28
|
+
Requires-Dist: uvicorn>=0.34; extra == 'demo'
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: build>=1.2.2; extra == 'dev'
|
|
31
|
+
Requires-Dist: mypy>=1.15; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=8.3; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.11; extra == 'dev'
|
|
35
|
+
Provides-Extra: docs
|
|
36
|
+
Requires-Dist: mkdocs-material>=9.6; extra == 'docs'
|
|
37
|
+
Requires-Dist: mkdocs>=1.6; extra == 'docs'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# agentproof
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+

|
|
44
|
+

|
|
45
|
+

|
|
46
|
+
[](LICENSE)
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
`agentproof` is an open-source Python library for agent-oriented verification challenges.
|
|
51
|
+
It gives Python services a clean way to issue deterministic, machine-checkable challenges that
|
|
52
|
+
are easier for programmatic agents to solve than for humans to complete manually.
|
|
53
|
+
|
|
54
|
+
The library does not claim cryptographic proof of model provenance. It focuses on a narrower,
|
|
55
|
+
defensible goal: structured challenge-response verification.
|
|
56
|
+
|
|
57
|
+
## Why this exists
|
|
58
|
+
|
|
59
|
+
Traditional CAPTCHA systems try to separate humans from bots. `agentproof` flips that framing:
|
|
60
|
+
it helps you design challenge-response checks that favor capable software agents and remain
|
|
61
|
+
verifiable on the server.
|
|
62
|
+
|
|
63
|
+
This is useful when you want to:
|
|
64
|
+
|
|
65
|
+
- gate access to agent-focused endpoints
|
|
66
|
+
- experiment with reverse-CAPTCHA style flows
|
|
67
|
+
- add a deterministic challenge layer to evaluation or abuse-control pipelines
|
|
68
|
+
- prototype agent-friendly verification without inventing your own format from scratch
|
|
69
|
+
|
|
70
|
+
## Design goals
|
|
71
|
+
|
|
72
|
+
- Keep verification deterministic and easy to reason about
|
|
73
|
+
- Make payloads JSON-friendly for APIs and job systems
|
|
74
|
+
- Keep the public API narrow and typed
|
|
75
|
+
- Document the threat model instead of overselling the guarantees
|
|
76
|
+
- Stay lightweight enough for experiments and production prototypes
|
|
77
|
+
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
- Typed Python API with a small public surface
|
|
81
|
+
- Deterministic challenge generation, solving, and verification
|
|
82
|
+
- Pluggable challenge families behind a shared protocol
|
|
83
|
+
- JSON-serializable payloads for APIs, queues, and services
|
|
84
|
+
- Reference CLI for demos and integration tests
|
|
85
|
+
- Built-in documentation, examples, CI, and release automation
|
|
86
|
+
|
|
87
|
+
## Challenge families
|
|
88
|
+
|
|
89
|
+
| Challenge type | Purpose | Verification style |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `proof_of_work` | Add deterministic compute cost | Leading-zero SHA256 check |
|
|
92
|
+
| `semantic_math_lock` | Favor structured text generation | Exact word constraints and ASCII initial sum |
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install agentproof-ai
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The published distribution name is `agentproof-ai`, while the import remains `agentproof`:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import agentproof
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For local development:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv sync --extra dev --extra docs --extra demo
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Public API
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Quickstart
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
|
|
122
|
+
|
|
123
|
+
spec = ChallengeSpec(challenge_type="proof_of_work", difficulty=18, ttl_seconds=120)
|
|
124
|
+
challenge = generate_challenge(spec)
|
|
125
|
+
response = solve_challenge(challenge)
|
|
126
|
+
result = verify_response(challenge, response)
|
|
127
|
+
|
|
128
|
+
assert result.ok
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Example output
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"ok": true,
|
|
136
|
+
"reason": "ok",
|
|
137
|
+
"details": {
|
|
138
|
+
"hash": "0007f5...",
|
|
139
|
+
"nonce": "18423"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Semantic challenge example
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from agentproof import ChallengeSpec, generate_challenge, solve_challenge, verify_response
|
|
148
|
+
|
|
149
|
+
challenge = generate_challenge(
|
|
150
|
+
ChallengeSpec(
|
|
151
|
+
challenge_type="semantic_math_lock",
|
|
152
|
+
ttl_seconds=90,
|
|
153
|
+
options={"topic": "security", "word_count": 7},
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
response = solve_challenge(challenge)
|
|
157
|
+
result = verify_response(challenge, response)
|
|
158
|
+
|
|
159
|
+
assert result.ok
|
|
160
|
+
print(response.payload["text"])
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Service integration example
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from agentproof import AgentResponse, Challenge, ChallengeSpec, generate_challenge, verify_response
|
|
167
|
+
|
|
168
|
+
challenge = generate_challenge(
|
|
169
|
+
ChallengeSpec(challenge_type="semantic_math_lock", options={"topic": "security", "word_count": 7})
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# ... send challenge.to_dict() to a client ...
|
|
173
|
+
|
|
174
|
+
response = AgentResponse(
|
|
175
|
+
challenge_id=challenge.challenge_id,
|
|
176
|
+
challenge_type=challenge.challenge_type,
|
|
177
|
+
payload={"text": "security demands careful metrics metrics metrics metrics"},
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
result = verify_response(challenge, response)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### CLI roundtrip
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
agentproof generate proof_of_work --difficulty 16 --output challenge.json
|
|
187
|
+
agentproof solve challenge.json --output response.json
|
|
188
|
+
agentproof verify challenge.json response.json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Verification model
|
|
192
|
+
|
|
193
|
+
```mermaid
|
|
194
|
+
sequenceDiagram
|
|
195
|
+
participant S as Service
|
|
196
|
+
participant A as Agent client
|
|
197
|
+
S->>A: Issue challenge JSON
|
|
198
|
+
A->>A: Solve challenge
|
|
199
|
+
A->>S: Submit structured response
|
|
200
|
+
S->>S: Verify deterministically
|
|
201
|
+
S-->>A: Accept or reject
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## CLI
|
|
205
|
+
|
|
206
|
+
Generate a challenge:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
agentproof generate proof_of_work --difficulty 18
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Solve a challenge from a file:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
agentproof solve challenge.json
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Verify a response:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
agentproof verify challenge.json response.json
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Demo project
|
|
225
|
+
|
|
226
|
+
A runnable local demo lives in [`demo/`](/home/borislav/VSCode/agentproof/demo). It is intended
|
|
227
|
+
for opening in VSCode and trying the package end-to-end with a small UI and example service flow.
|
|
228
|
+
|
|
229
|
+
## Threat model
|
|
230
|
+
|
|
231
|
+
`agentproof` helps with agent-oriented challenge-response flows. It does **not** prove:
|
|
232
|
+
|
|
233
|
+
- model provenance
|
|
234
|
+
- provider identity
|
|
235
|
+
- hardware-backed execution
|
|
236
|
+
- immunity against determined scripted attackers
|
|
237
|
+
|
|
238
|
+
Use it as one verification signal, not as a complete trust system.
|
|
239
|
+
|
|
240
|
+
## Security and scope
|
|
241
|
+
|
|
242
|
+
`agentproof` is not an identity or attestation system. It does not prove that a request came
|
|
243
|
+
from a specific model provider or hardware-backed agent. The current scope is challenge-response
|
|
244
|
+
verification with explicit tradeoffs documented in the threat model.
|
|
245
|
+
|
|
246
|
+
## Modern repo defaults
|
|
247
|
+
|
|
248
|
+
- GitHub Actions CI across Python 3.10 to 3.13
|
|
249
|
+
- Typed package with `py.typed`
|
|
250
|
+
- Coverage gate at 90%+
|
|
251
|
+
- MkDocs documentation site
|
|
252
|
+
- Dependabot config and issue templates
|
|
253
|
+
- PyPI release workflow prepared for trusted publishing
|
|
254
|
+
|
|
255
|
+
## Development
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
uv run ruff check .
|
|
259
|
+
uv run mypy .
|
|
260
|
+
uv run pytest
|
|
261
|
+
uv run python -m build
|
|
262
|
+
uv run mkdocs build --strict
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Release model
|
|
266
|
+
|
|
267
|
+
- `main` runs lint, type checks, tests, package builds, and docs builds in GitHub Actions
|
|
268
|
+
- version tags trigger package publishing through the release workflow
|
|
269
|
+
- PyPI publishing is configured for trusted publishing, so the repository should be linked to the
|
|
270
|
+
target PyPI project before pushing a release tag
|
|
271
|
+
|
|
272
|
+
## Contributing
|
|
273
|
+
|
|
274
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup and quality checks.
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT
|