Skip to main content

genai-auditor

LangChain に統合できる GenAI コンプライアンス監査パッケージです。

ディレクトリ構成

genai-auditor/
├── pyproject.toml          # ビルド・メタデータ(PyPI 公開用)
├── README.md
├── example.py              # 開発者向け動作確認スクリプト
└── src/
    └── genai_auditor/
        ├── __init__.py     # パッケージエントリ(ComplianceAuditCallbackHandler を公開)
        └── callback.py     # コールバック実装・監査ログ生成・保存ロジック

EU AI Act 等の 2026 年 AI 法規制に対応するため、LLM の入力・出力・モデル名を自動取得し、改ざん防止用のプロビナンスハッシュ付きで監査ログを保存します。

インストール

pip install genai-auditor

開発版(ローカル):

pip install -e /path/to/genai-auditor

3 行で導入

既存の LangChain コードにコールバックを渡すだけで監査が有効になります。

from langchain_openai import ChatOpenAI
from genai_auditor import ComplianceAuditCallbackHandler

audit = ComplianceAuditCallbackHandler()
llm = ChatOpenAI(model="gpt-4o-mini", callbacks=[audit])
response = llm.invoke("こんにちは")

監査ログはデフォルトで audit_logs.json に追記されます。

監査ログの形式

各エントリには以下が含まれます。

  • run_id: LangChain の実行 ID
  • model_name: 使用したモデル名
  • prompts: 入力プロンプト(リスト)
  • outputs: LLM 出力テキスト(リスト)
  • started_at / ended_at: ISO 8601 タイムスタンプ(UTC)
  • provenance_hash: 上記フィールドから計算した SHA-256 ハッシュ(改ざん検知用)

ログファイルの指定

audit = ComplianceAuditCallbackHandler(audit_log_path="./logs/compliance.json")

ライセンス

MIT

Metadata

Release files for genai-auditor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genai-auditor 0.1.0
File Size Uploaded Provenance
genai_auditor-0.1.0.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for genai-auditor 0.1.0
File Interpreter ABI Platform
genai_auditor-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / genai_auditor-0.1.0.tar.gz

Download URL genai_auditor-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3b48ef942cde490c9229cc5679b9bcb89869cb8e55c8e594a36df61f220d17c2
BLAKE2b-256 checksum
How to use checksums
7608830d8614ef2db25fa0793f737015deade278065d028da7cdbbb6ac7d3e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / genai_auditor-0.1.0-py3-none-any.whl

Download URL genai_auditor-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d7a8a902036fea4b347dcaeec7905d78a9d83bbac847d0f733889f3676acba
BLAKE2b-256 checksum
How to use checksums
627426b318b7d8564401601225c9e5842f9f4869824770a692be1a7e920c85bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for genai-auditor 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page