Metadata-Version: 2.5
Name: gfg-adr-detection
Version: 0.3.0
Summary: GFG packaging of ADR Detection (uber/ADR) for agentic security detection
Project-URL: Homepage, https://github.com/uber/ADR
Project-URL: Documentation, https://github.com/uber/ADR/tree/master/Detection
Project-URL: Repository, https://github.com/uber/ADR
Project-URL: Issues, https://github.com/uber/ADR/issues
Author: ADR Project Contributors, Global Fashion Group
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai-agents,benchmark,mcp,security,threat-detection
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: <3.13,>=3.10
Requires-Dist: aiohttp==3.11.18
Requires-Dist: anthropic>=0.25.0
Requires-Dist: arxiv>=2.2.0
Requires-Dist: beautifulsoup4==4.13.3
Requires-Dist: claude-code-sdk>=0.0.25
Requires-Dist: click==8.1.8
Requires-Dist: cryptography>=40.0.0
Requires-Dist: deepdiff==8.6.1
Requires-Dist: dnspython>=2.3.0
Requires-Dist: docker==6.1.2
Requires-Dist: docstring-parser==0.16
Requires-Dist: fastapi>=0.103.0
Requires-Dist: fastmcp>=0.1.0
Requires-Dist: flask-cors>=4.0.0
Requires-Dist: flask>=2.3.0
Requires-Dist: folium>=0.14.0
Requires-Dist: geopy>=2.3.0
Requires-Dist: google-cloud-aiplatform==1.71.1
Requires-Dist: google-generativeai>=0.3.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: ipython==8.12.3
Requires-Dist: jsonref==1.1.0
Requires-Dist: jsonschema>=4.0.0
Requires-Dist: langchain-anthropic==0.3.1
Requires-Dist: langchain-core==0.3.28
Requires-Dist: langchain-google-genai==2.0.8
Requires-Dist: langchain-openai==0.2.14
Requires-Dist: langchain==0.3.13
Requires-Dist: langgraph==0.2.60
Requires-Dist: llamafirewall>=0.0.0
Requires-Dist: markitdown[all]>=0.1.2
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: moviepy>=1.0.3
Requires-Dist: nemoguardrails==0.14.0
Requires-Dist: nltk>=3.8
Requires-Dist: numpy>=1.26.2
Requires-Dist: openai>=1.76.0
Requires-Dist: openapi-pydantic==0.3.0
Requires-Dist: opencv-python>=4.7.0
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: pandas==2.2.3
Requires-Dist: pillow>=9.5.0
Requires-Dist: proto-plus==1.28.2
Requires-Dist: psutil>=5.9.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic[email]>=2.11.3
Requires-Dist: pydub>=0.25.1
Requires-Dist: pypdf2>=3.0.0
Requires-Dist: python-docx>=1.1.2
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-pptx>=1.0.2
Requires-Dist: pyyaml==6.0.2
Requires-Dist: requests>=2.32.0
Requires-Dist: rich==13.9.4
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: seaborn>=0.12.0
Requires-Dist: spacy>=3.6.0
Requires-Dist: statsmodels>=0.14.0
Requires-Dist: tenacity==9.0.0
Requires-Dist: textblob>=0.17.1
Requires-Dist: tokenizers>=0.21.2
Requires-Dist: torch>=2.7.1
Requires-Dist: tqdm>=4.66
Requires-Dist: transformers>=4.53.2
Requires-Dist: tushare>=1.4.21
Requires-Dist: typer>=0.9.0
Requires-Dist: typing-extensions==4.12.2
Requires-Dist: uvicorn>=0.23.0
Requires-Dist: websocket-client>=1.8.0
Provides-Extra: dev
Requires-Dist: black>=26.5.1; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: notebook
Requires-Dist: jupyter>=1.0.0; extra == 'notebook'
Description-Content-Type: text/markdown

# gfg-adr-detection

A packaged, importable build of **ADR Detection** from
[uber/ADR](https://github.com/uber/ADR), maintained by Global Fashion Group for
internal use and published so it can be installed with `pip` rather than cloned.

**Not affiliated with or endorsed by Uber.** This is a modified redistribution
under the Apache License 2.0; the original copyright and `LICENSE` are retained.
For the upstream project, its paper and its benchmark, go to
[github.com/uber/ADR](https://github.com/uber/ADR).

## ⚠️ Not a general-purpose library

ADR Detection is a **research artifact**. Several of its dependencies are pinned
to exact versions for benchmark reproducibility and carry known CVEs, which
upstream documents and accepts under an isolated threat model. Run it in a
container, VM or dedicated host — not alongside your application.

It is also unusually heavy: the dependency closure includes `torch`,
`transformers` and the LangChain stack, and its hard `==` pins will conflict with
most other packages. Install it into a dedicated virtualenv.

## What this package changes

Upstream resolves its runtime data relative to `__file__`, three directories up —
which is the source tree in a checkout, and `site-packages` once installed. The
practical effect was that an installed copy discovered **zero** MCP context
providers and silently degraded from two detection tiers to one, with no error.
This build fixes that and the related path assumptions:

- context providers resolve from inside the package (`ADR_CONTEXT_PROVIDERS_DIR`
  overrides; the original layout is still honoured for source checkouts)
- the reasoning workspace is relocatable via `ADR_WORKSPACE_ROOT`, instead of
  being created inside `site-packages`
- MCP servers launch with `sys.executable` rather than `uv run`, which resolved
  an unrelated environment when installed as a wheel
- the import package is `adr_guardrail`, not `guardrail`, which PyPI already
  assigns to an unrelated project
- the dependency `axios` is dropped — it is a JavaScript library, and the PyPI
  project of that name is unrelated to it and to ADR
- the 16 MB benchmark corpus is not shipped, so the source-code context provider
  is disabled by default (`enable_source_code: false`)

## Install

```sh
python -m venv .venv && .venv/bin/pip install gfg-adr-detection
```

Requires Python 3.10–3.12.

## Use

```python
from adr_guardrail.adr_agent.adr_baseline import ADRBaseline

detector = ADRBaseline(config_data=config, benchmark_type="adr_bench")
verdict = detector.analyze_conversation(messages).to_dict()
```

`config` is the parsed `config_detector.yaml` structure documented upstream. The
high-precision tier shells out to the Claude CLI, which refuses to run as root —
so give the container an unprivileged user.

## Licence

Apache-2.0, as the original. See `LICENSE`.
