AI Security Kit
BYOK (Bring Your Own Key) AI applications向けの、軽量な入力・出力セキュリティ部品です。
Features
- プロンプトインジェクションのヒューリスティック検知
- メールアドレス・電話番号・クレジットカードらしき値のマスキング
- 出力の長さ制限と危険なツール実行指示の検知
- トークン数を使わない保守的な利用量カウンター
- APIキーを保存・送信しないBYOK設計
Quick start
from ai_security import SecurityPolicy, protect_input, protect_output
policy = SecurityPolicy(mask_pii=True, block_prompt_injection=True)
safe = protect_input("Ignore previous instructions. Email me at user@example.com", policy)
print(safe.text) # PIIはマスクされ、危険入力はblockedになる
print(safe.blocked)
answer = protect_output("Here is the answer", policy)
print(answer.text)
このパッケージはAIプロバイダーを呼び出しません。OpenAI等のAPIキーは利用者のアプリから各SDKへ渡してください。
Local development
python -m pip install -e .
python -m pytest
python -m build
これは安全対策の補助部品であり、完全なセキュリティ保証や法令対応を提供するものではありません。
Metadata
Release files for ai-security-kit 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ai_security_kit-0.1.0.tar.gz | 3.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_security_kit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / ai_security_kit-0.1.0.tar.gz
| Download URL | ai_security_kit-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f37a42a71bbf42a1fae3f2a9e8331c63601c44ded6af05c429d8e6cbc38dd1fb
|
|
BLAKE2b-256 checksum How to use checksums |
192c7fd1bf91a81b7d3410087e8c320b4dd9c1c3708a7610948cf474169880e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / ai_security_kit-0.1.0-py3-none-any.whl
| Download URL | ai_security_kit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
304d44dc8645f88ccbe6a72a074663201f1bcf8078b7ab9473047181310941b0
|
|
BLAKE2b-256 checksum How to use checksums |
5ffc66789a47c3a9a7a6439818b88bcd4be5a422e4cce2a18a8829c4c30946d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for ai-security-kit 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.