tork/governance 问题修复 & 功能扩展

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

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

tork/governance

最新稳定版本:v0.1.0

Composer 安装命令:

composer require tork/governance

包简介

On-device AI governance SDK - PII detection, redaction, and cryptographic receipts

README 文档

README

On-device AI governance for PHP applications. PII detection, redaction, and cryptographic compliance receipts.

Installation

composer require tork/governance

Quick Start

<?php

use Tork\Governance\Core\Tork;

$tork = new Tork();

$result = $tork->govern("Contact john@example.com or call 555-123-4567");

echo $result->action;  // "redact"
echo $result->output;  // "Contact [EMAIL_REDACTED] or call [PHONE_REDACTED]"

Regional PII Detection (v1.1)

Activate country-specific and industry-specific PII patterns:

$tork = new Tork();

// UAE regional detection — Emirates ID, +971 phone, PO Box
$result = $tork->govern(
    "Emirates ID: 784-1234-1234567-1",
    region: ['ae']
);

// Multi-region + industry
$result = $tork->govern(
    "Aadhaar: 1234 5678 9012, ICD-10: J45.20",
    region: ['in'],
    industry: 'healthcare'
);

// Available regions: AU, US, GB, EU, AE, SA, NG, IN, JP, CN, KR, BR
// Available industries: healthcare, finance, legal

Laravel Integration

The SDK auto-registers via Laravel's package discovery.

// In routes/api.php
Route::middleware('tork')->group(function () {
    Route::post('/users', [UserController::class, 'store']);
});

// Publish config (optional)
php artisan vendor:publish --tag=tork-config

Access in controllers:

$tork = $request->attributes->get('tork');
$receipts = $request->attributes->get('torkReceipts');

Symfony Integration

1. Register the bundle

// config/bundles.php
return [
    // ...
    Tork\Governance\Symfony\TorkBundle::class => ['all' => true],
];

2. Configure (optional)

# config/packages/tork.yaml
tork:
    default_action: redact
    policy_version: '1.0.0'
    middleware:
        governInput: true
        governOutput: true
        governBody: true

3. Use in controllers

class ApiController extends AbstractController
{
    public function index(Request $request): JsonResponse
    {
        $tork = $request->attributes->get('tork');
        $receipts = $request->attributes->get('torkReceipts');

        // Your logic here...
    }
}

Documentation

Visit tork.network for full documentation.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固