Metadata-Version: 2.4
Name: rai-audit-agents
Version: 0.1.8
Summary: Agentic AI audits for tool-use, memory, permissions, and prompt injection
Author: Sai Teja Erukude
License: MIT License
        
        Copyright (c) 2026 Sai Teja Erukude
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agent-safety,agentic-ai,prompt-injection,responsible-ai,tool-use
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: rai-audit-core>=0.1.0
Description-Content-Type: text/markdown

# rai-audit-agents

Agentic AI audits for tool use, memory, permissions, and prompt injection delivered
through tools, retrieval, email, or webpages.

Checks also cover instruction poisoning persisted into agent memory and bounded
tool-execution budgets. Agent findings include OWASP Agentic Top 10 2026 mappings
where applicable.

Additional controls cover tool arguments, scoped identities, credential
propagation, MCP/tool manifests, recursion and retry limits, stop signals,
reversible high-impact actions, authenticated handoffs, and delegated
permissions. Reports include an explicit OWASP Agentic Top 10 2026 evidence map.

## Trace Schema

The canonical versioned JSON schema follows the current OpenTelemetry GenAI operation vocabulary.
New traces should set `"schema_version": "1.0"`; unversioned traces are migrated
during loading:
`invoke_agent`, `invoke_workflow`, `execute_tool`, and `retrieval`. Events emit aligned
attributes such as `gen_ai.agent.name`, `gen_ai.tool.name`, and
`gen_ai.data_source.id`.

OpenTelemetry currently marks its GenAI agent conventions as Development, so the
schema preserves a general `attributes` mapping alongside stable audit fields.

## CLI

```bash
rai-audit agents run \
  --trace packages/rai-audit-agents/examples/customer_support_trace.json \
  --allowed-tools lookup_order \
  --format html
```

## Python API

```python
from rai_audit.agents import AgentAudit, load_trace

trace = load_trace("packages/rai-audit-agents/examples/customer_support_trace.json")
report = AgentAudit(trace, allowed_tools=["lookup_order"], persist=False).run()
```

## Framework Adapters

Adapters normalize captured records without requiring framework installations:

```python
from rai_audit.agents import (
    adapt_autogen_messages,
    adapt_langgraph_events,
    adapt_openai_agents_trace,
    adapt_otel_spans,
)
```

References:

- [OpenTelemetry GenAI agent spans](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/)
- [OpenTelemetry GenAI spans](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/)
- [OpenAI Agents SDK tracing](https://openai.github.io/openai-agents-python/tracing/)
