guardian-runtime 0.1.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.
- guardian_runtime-0.1.0/.github/workflows/ci.yml +37 -0
- guardian_runtime-0.1.0/.gitignore +68 -0
- guardian_runtime-0.1.0/ARCHITECTURE.md +1916 -0
- guardian_runtime-0.1.0/PKG-INFO +622 -0
- guardian_runtime-0.1.0/PLAN.md +224 -0
- guardian_runtime-0.1.0/README.md +577 -0
- guardian_runtime-0.1.0/concept.md +462 -0
- guardian_runtime-0.1.0/guardian/__init__.py +51 -0
- guardian_runtime-0.1.0/guardian/cli/__init__.py +0 -0
- guardian_runtime-0.1.0/guardian/cli/main.py +17 -0
- guardian_runtime-0.1.0/guardian/core/__init__.py +0 -0
- guardian_runtime-0.1.0/guardian/core/engine.py +19 -0
- guardian_runtime-0.1.0/guardian/core/license.py +21 -0
- guardian_runtime-0.1.0/guardian/core/policy.py +290 -0
- guardian_runtime-0.1.0/guardian/core/storage.py +27 -0
- guardian_runtime-0.1.0/guardian/finops/__init__.py +0 -0
- guardian_runtime-0.1.0/guardian/finops/cost_calculator.py +29 -0
- guardian_runtime-0.1.0/guardian/finops/token_counter.py +14 -0
- guardian_runtime-0.1.0/guardian/guards/__init__.py +0 -0
- guardian_runtime-0.1.0/guardian/guards/validators/__init__.py +0 -0
- guardian_runtime-0.1.0/guardian/guards/validators/hallucination.py +31 -0
- guardian_runtime-0.1.0/guardian/guards/validators/jailbreak.py +33 -0
- guardian_runtime-0.1.0/guardian/guards/validators/pii.py +369 -0
- guardian_runtime-0.1.0/policies/minimal.yaml +18 -0
- guardian_runtime-0.1.0/pyproject.toml +83 -0
- guardian_runtime-0.1.0/tests/__init__.py +0 -0
- guardian_runtime-0.1.0/tests/conftest.py +57 -0
- guardian_runtime-0.1.0/tests/unit/__init__.py +0 -0
- guardian_runtime-0.1.0/tests/unit/test_pii.py +238 -0
- guardian_runtime-0.1.0/tests/unit/test_policy.py +340 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -e ".[dev]"
|
|
28
|
+
|
|
29
|
+
- name: Lint with ruff
|
|
30
|
+
run: ruff check guardian/
|
|
31
|
+
|
|
32
|
+
- name: Type check with mypy
|
|
33
|
+
run: mypy guardian/ --ignore-missing-imports
|
|
34
|
+
continue-on-error: true # non-blocking until codebase is typed
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: pytest tests/ -v --tb=short
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.eggs/
|
|
11
|
+
*.egg
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
venv/
|
|
15
|
+
.venv/
|
|
16
|
+
env/
|
|
17
|
+
.env/
|
|
18
|
+
|
|
19
|
+
# Distribution / packaging
|
|
20
|
+
.installed.cfg
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
share/python-wheels/
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
.nox/
|
|
35
|
+
|
|
36
|
+
# Type checking
|
|
37
|
+
.mypy_cache/
|
|
38
|
+
.dmypy.json
|
|
39
|
+
dmypy.json
|
|
40
|
+
|
|
41
|
+
# Ruff
|
|
42
|
+
.ruff_cache/
|
|
43
|
+
|
|
44
|
+
# IDE
|
|
45
|
+
.idea/
|
|
46
|
+
.vscode/
|
|
47
|
+
*.swp
|
|
48
|
+
*.swo
|
|
49
|
+
*~
|
|
50
|
+
.DS_Store
|
|
51
|
+
|
|
52
|
+
# Environment variables
|
|
53
|
+
.env
|
|
54
|
+
.env.local
|
|
55
|
+
.env.*.local
|
|
56
|
+
|
|
57
|
+
# Guardian local data (never commit ~/.guardian but also never commit
|
|
58
|
+
# any local test keys or usage files in the repo root)
|
|
59
|
+
*.guardian_key
|
|
60
|
+
test_config.json
|
|
61
|
+
|
|
62
|
+
# Logs
|
|
63
|
+
*.log
|
|
64
|
+
*.jsonl
|
|
65
|
+
|
|
66
|
+
# Secrets
|
|
67
|
+
*.pem
|
|
68
|
+
*.key
|