Skip to content

Commit ce34be0

Browse files
authored
Merge pull request #3 from PredicateSystems/p3
Phase 3: debug mode
2 parents 7c3f232 + 9a0dde6 commit ce34be0

9 files changed

Lines changed: 1494 additions & 33 deletions

File tree

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
workflow_dispatch:
7+
inputs:
8+
publish:
9+
description: "Publish to PyPI"
10+
required: true
11+
default: "false"
12+
type: choice
13+
options: ["false", "true"]
14+
15+
jobs:
16+
quality:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install -e ".[dev]"
31+
32+
- name: Run tests
33+
run: python -m pytest -q
34+
35+
- name: Run security checks
36+
run: python -m bandit -q -r src/predicate_secure/
37+
38+
- name: Run pre-commit checks
39+
run: |
40+
python -m pip install pre-commit
41+
pre-commit run --all-files
42+
43+
publish:
44+
runs-on: ubuntu-latest
45+
needs: [quality]
46+
if: (github.event_name == 'workflow_dispatch' && inputs.publish == 'true') || startsWith(github.ref, 'refs/tags/v')
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: "3.11"
55+
56+
- name: Install build tooling
57+
run: python -m pip install --upgrade pip build twine
58+
59+
- name: Validate version matches tag
60+
if: startsWith(github.ref, 'refs/tags/v')
61+
run: |
62+
TAG_VERSION="${GITHUB_REF_NAME#v}"
63+
PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
64+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
65+
echo "Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)"
66+
exit 1
67+
fi
68+
echo "Version validated: $PKG_VERSION"
69+
70+
- name: Build package
71+
run: python -m build
72+
73+
- name: Validate distribution metadata
74+
run: twine check dist/*
75+
76+
- name: Publish to PyPI
77+
env:
78+
TWINE_USERNAME: __token__
79+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_PREDICATE_SECURE }}
80+
run: twine upload dist/*

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# predicate-secure
22

3+
[![License](https://img.shields.io/badge/License-MIT%2FApache--2.0-blue.svg)](LICENSE)
4+
[![PyPI - predicate-secure](https://img.shields.io/pypi/v/predicate-secure.svg)](https://pypi.org/project/predicate-secure/)
5+
36
Drop-in security wrapper for AI agents. Adds authorization, verification, and audit to any agent framework in 3 lines of code.
47

58
## Features
@@ -67,8 +70,8 @@ secure_agent.run()
6770

6871
`predicate-secure` is a thin orchestration layer that combines:
6972

70-
- **predicate** (sdk-python) - Snapshot engine, DOM pruning, verification predicates
71-
- **predicate-authority** (AgentIdentity) - Policy engine, mandate signing, audit logging
73+
- **[predicate-runtime](https://github.com/PredicateSystems/sdk-python)** - Snapshot engine, DOM pruning, verification predicates
74+
- **[predicate-authority](https://github.com/PredicateSystems/predicate-authority)** - Policy engine, mandate signing, audit logging
7275

7376
```
7477
SecureAgent

0 commit comments

Comments
 (0)