laravelsecurityaudit/laravel-ai-ledger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravelsecurityaudit/laravel-ai-ledger

Composer 安装命令:

composer require laravelsecurityaudit/laravel-ai-ledger

包简介

A processing ledger for AI traffic. Turns the requests Egress Guard observes into a GDPR Article 30 record of processing and a subprocessor register, recording categories and hashes only, never the data itself. The free collector for the Ledger compliance layer.

README 文档

README

A processing ledger for AI traffic. It turns the requests Egress Guard observes into the AI-subprocessor portion of a GDPR Article 30 record of processing, so you can answer, with evidence, which personal data goes to which AI provider, processed where, under what contract, and for how long.

It records categories and hashes only, never the data itself. A record says "an email address and a payment card were sent to OpenAI (EU region), the card redacted before send, under SCCs, 30-day retention". It never stores the email or the card.

This is the free collector. The independent witness (tamper-evidence an auditor accepts) and the always-current subprocessor dataset are the hosted Ledger Cloud (paid).

This is an independent open-source package. It is not affiliated with, endorsed by, or sponsored by Laravel, Laravel LLC, or any AI provider. It documents and evidences processing; it does not make your app compliant. Have a DPO or privacy counsel own the legal content and review the output. This is not legal advice.

Requirements

  • PHP 8.2+, Laravel 12 or 13
  • laravelsecurityaudit/laravel-ai-egress-guard (it provides the AiRequestCaptured signal)

Installation

composer require laravelsecurityaudit/laravel-ai-ledger
php artisan migrate

It subscribes to Egress Guard automatically. Every captured AI request becomes a category-only processing record.

What it records

For each AI call: the subprocessor and its company, the processing region, sub-subprocessors, the purpose (configured per route), the categories of personal data detected, a pseudonymous data-subject reference, the legal basis, whether it is a third-country transfer and the safeguard, which categories were redacted before send, the provider retention, and a local hash chain. The provider facts come from the SubprocessorRegistry; the categories come from Egress Guard's findings.

Export

php artisan ai-ledger:export --type=ropa --format=markdown
php artisan ai-ledger:export --type=register --format=json --output=subprocessors.json

ropa is the Article 30 record grouped by subprocessor; register is the subprocessor register from the dataset.

Configuration

php artisan vendor:publish --tag=ai-ledger-config

Set your controller_ref, the default legal_basis, per-source purposes, the processing regions you actually use, the residency allowed_regions, the categories map, and the subprocessors dataset. Verify the dataset against each provider's current terms, or let Ledger Cloud maintain it.

Residency

Set residency.allowed_regions (for example ['EU']). A request to a provider whose region is not allowed is recorded with residency_ok = false. To also block it at runtime, enable Egress Guard's residency enforcement (egress-guard.residency), which blocks out-of-region calls at the wire.

The paid layer

Set AI_LEDGER_CLOUD_ENDPOINT and AI_LEDGER_CLOUD_TOKEN to enable the hosted witness: each record's hash is counter-signed by a party your app does not control, which is what makes the chain credible to an auditor. Without a token the cloud client is a no-op and everything runs locally.

Testing

composer test
composer analyse

The Laravel Security Audit family

One detection engine, guarding every place data leaves your app.

Package What it guards
laravel-secret-scanner Shared secret and PII detection engine (the core)
laravel-mail-guard Outgoing Laravel mail
laravel-ai-egress-guard Outbound AI provider traffic (OpenAI, Anthropic, Gemini)
laravel-ai-lint Static analysis: leaked AI keys and unsafe AI wiring
laravel-ai-circuit-breaker Runaway AI loops and spend
laravel-ai-ledger (this package) GDPR Article 30 processing ledger for AI traffic
ledger-cloud Independent signed witness for ledger records

License

The MIT License (MIT). See LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固