From bca6c95a52be816b4d7e520379ccc6a917495d60 Mon Sep 17 00:00:00 2001 From: Ceaseless04 Date: Mon, 2 Mar 2026 23:38:01 -0500 Subject: [PATCH 1/2] Updated documentation --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 063fe26..0731a02 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,21 @@ work. ## Getting Started -Install via pip (when released) or add the package to your project: +Install via pip (when released) or add the package to your project. ```bash -pip install agentshield +pip install agentshield-api ``` +*If you’re just trying the library out against a test index, you can +install from TestPyPI with:* + +```bash +pip install -i https://test.pypi.org/simple agentshield-api +``` + +Note that the distribution on PyPI is named **agentshield-api** (not +`agentshield`) to avoid collisions with other projects. ```python from agentshield import SecureFS, OutputGuard @@ -65,6 +74,38 @@ scanner.register_pattern("MY_SECRET", re.compile(r"mysecret=\S+")) Patterns are applied in the order they are registered, and you can also provide a custom list during initialization. +## Custom policy + +By default the library loads a YAML file named `default_policy.yaml` from the +`policies/` directory in the package. You can override this behaviour by +suppling your own `Policy` instance: + +```python +from agentshield import SecureFS, Policy + +policy = Policy(allowed=["ENV_VAR"], blocked=["API_KEY"], block_mode="error") +fs = SecureFS(policy=policy) +``` + +Or create your own YAML file and load it: + +```python +p = Policy.load_from_file("/path/to/my_policy.yaml") +guard = OutputGuard(policy=p) +``` + +The configuration schema is simple: + +```yaml +allowed: + - ENV_VAR +blocked: + - API_KEY +block_mode: redact # or error or warn +``` + +This makes it easy to adapt AgentShield to your project’s risk profile. + ## Project Structure ``` @@ -79,6 +120,10 @@ policies/ default_policy.yaml examples/ example_usage.py +tests/ + test_*.py +pyproject.toml +requirements.txt README.md LICENSE ``` From 29a4abceb2f1fa05ae8a418d6d845c607dede29e Mon Sep 17 00:00:00 2001 From: Ceaseless04 Date: Mon, 2 Mar 2026 23:39:51 -0500 Subject: [PATCH 2/2] Remove build artefacts --- agentshield.egg-info/PKG-INFO | 101 ---------------------- agentshield.egg-info/SOURCES.txt | 19 ---- agentshield.egg-info/dependency_links.txt | 1 - agentshield.egg-info/requires.txt | 4 - agentshield.egg-info/top_level.txt | 1 - 5 files changed, 126 deletions(-) delete mode 100644 agentshield.egg-info/PKG-INFO delete mode 100644 agentshield.egg-info/SOURCES.txt delete mode 100644 agentshield.egg-info/dependency_links.txt delete mode 100644 agentshield.egg-info/requires.txt delete mode 100644 agentshield.egg-info/top_level.txt diff --git a/agentshield.egg-info/PKG-INFO b/agentshield.egg-info/PKG-INFO deleted file mode 100644 index f484ab7..0000000 --- a/agentshield.egg-info/PKG-INFO +++ /dev/null @@ -1,101 +0,0 @@ -Metadata-Version: 2.4 -Name: agentshield -Version: 0.1.2 -Summary: Secure middleware SDK for AI agents. -Author-email: Kristian Vazquez -License-Expression: Apache-2.0 -Description-Content-Type: text/markdown -License-File: LICENSE -Requires-Dist: PyYAML>=5.1 -Provides-Extra: dev -Requires-Dist: pytest>=7.0; extra == "dev" -Dynamic: license-file - -# AgentShield - -AgentShield is a lightweight Python SDK (v0.1.1) that provides a secure middleware -layer between AI agents and developer resources such as repositories, -file systems, APIs, and tools. - -Its purpose is to prevent accidental leakage of sensitive data (API keys, -passwords, tokens, etc.) while still allowing agents to perform useful -work. - -## Features - -* **SecureFS** – safe file reader that scans and redacts secrets. -* **SecretScanner** – regex/entropy-based detection engine. -* **Redactor** – replaces detected secrets with placeholders. -* **OutputGuard** – inspects agent outputs and blocks or redacts leaks. -* **Policy** – YAML-driven configuration for allowed/blocked types. - -## Getting Started - -Install via pip (when released) or add the package to your project: - -```bash -pip install agentshield -``` - -```python -from agentshield import SecureFS, OutputGuard - -fs = SecureFS() -safe_content = fs.read_file("config.env") - -guard = OutputGuard() -clean_output = guard.inspect("some text containing secret=abc123") -``` - -### Running the test suite - -A small pytest-based test suite lives under `tests/`. After installing -requirements (`PyYAML`, `pytest`), run: - -```bash -python -m pytest -q -``` - -You should see five tests covering core functionality. - - -## Project Structure - -### Extending detection - -The :class:`agentshield.secret_scanner.SecretScanner` class ships with a -set of common regexes (API keys, tokens, AWS formats, JWTs, etc.). If -you need to recognise additional secrets, simply: - -```python -from agentshield.secret_scanner import SecretScanner -import re - -scanner = SecretScanner() -scanner.register_pattern("MY_SECRET", re.compile(r"mysecret=\S+")) -``` - -Patterns are applied in the order they are registered, and you can also -provide a custom list during initialization. - -## Project Structure - -``` -agentshield/ - __init__.py - secure_fs.py - secret_scanner.py - redactor.py - output_guard.py - policy.py -policies/ - default_policy.yaml -examples/ - example_usage.py -README.md -LICENSE -``` - -## License - -This project is open source under the Apache license. diff --git a/agentshield.egg-info/SOURCES.txt b/agentshield.egg-info/SOURCES.txt deleted file mode 100644 index 187a4ac..0000000 --- a/agentshield.egg-info/SOURCES.txt +++ /dev/null @@ -1,19 +0,0 @@ -LICENSE -README.md -pyproject.toml -agentshield/__init__.py -agentshield/output_guard.py -agentshield/policy.py -agentshield/redactor.py -agentshield/secret_scanner.py -agentshield/secure_fs.py -agentshield.egg-info/PKG-INFO -agentshield.egg-info/SOURCES.txt -agentshield.egg-info/dependency_links.txt -agentshield.egg-info/requires.txt -agentshield.egg-info/top_level.txt -tests/test_output_guard.py -tests/test_policy.py -tests/test_redactor.py -tests/test_scanner.py -tests/test_securefs.py \ No newline at end of file diff --git a/agentshield.egg-info/dependency_links.txt b/agentshield.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/agentshield.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/agentshield.egg-info/requires.txt b/agentshield.egg-info/requires.txt deleted file mode 100644 index f90f260..0000000 --- a/agentshield.egg-info/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -PyYAML>=5.1 - -[dev] -pytest>=7.0 diff --git a/agentshield.egg-info/top_level.txt b/agentshield.egg-info/top_level.txt deleted file mode 100644 index 1f31f15..0000000 --- a/agentshield.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -agentshield