Federated 学习 Hom
- 作者仓库星标 0
- 作者仓库 skills-registry
Federated Learning Homomorphic
Skill Profile
(Select at least one profile to enable specific modules)
- DevOps
- Backend
- Frontend
- AI-RAG
- Security Critical
Overview
This skill covers the implementation of privacy-preserving machine learning techniques that enable training models on distributed, sensitive data without exposing raw data. It includes Federated Learning for distributed training, Homomorphic Encryption for computation on encrypted data, and Secure Multi-Party Computation (SMPC) for collaborative computation.
Why This Matters
- Data Privacy: Enables ML on sensitive data without privacy violations
- Regulatory Compliance: Meets GDPR, HIPAA, and other data protection regulations
- Collaborative Learning: Multiple organizations can collaborate without sharing data
Core Concepts & Rules
1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
Inputs / Outputs / Contracts
- Inputs:
- Local datasets on client devices (never transmitted to server)
- Model architecture and hyperparameters
- Privacy budget parameters (epsilon, delta)
- Client selection criteria and participation requirements
- Entry Conditions:
- TensorFlow Federated or PySyft installed
- HE library (SEAL/TenSEAL) configured
- Client devices with local data available
- Secure communication channels established (TLS 1.3)
- Outputs:
- Trained global model
- Client participation metrics and contribution tracking
- Privacy loss accounting reports
- Model performance evaluation on test data
- Artifacts Required (Deliverables):
- Federated training configuration
- Client-side training scripts
- Server aggregation logic
- Privacy audit reports
- Acceptance Evidence:
- Model achieves target accuracy without exposing raw data
- Privacy budget not exceeded
- Client contributions properly tracked
- Communication overhead within acceptable limits
- Success Criteria:
- Model accuracy within 5% of centralized training baseline
- Privacy budget epsilon < 1.0 for DP-SGD
- Communication overhead < 10x centralized training
- Training completes within 2x centralized training time
Skill Composition
- Depends on: model-serving-inference, mlflow-patterns
- Compatible with: drift-detection-retraining, pii-policy-enforcement
- Conflicts with: None
- Related Skills: llm-security-redteaming
Quick Start / Implementation Example
- Review requirements and constraints
- Set up development environment
- Implement core functionality following patterns
- Write tests for critical paths
- Run tests and fix issues
- Document any deviations or decisions
# Example implementation following best practices
def example_function():
# Your implementation here
pass
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.examplekeys:API_KEY,DATABASE_URL(no values)
Test Scenario Matrix (QA Strategy)
| Type | Focus Area | Required Scenarios / Mocks |
|---|---|---|
| Unit | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration | DB / API | All external API calls or database connections must be mocked during unit tests |
| E2E | User Journey | Critical user flows to test |
| Performance | Latency / Load | Benchmark requirements |
| Security | Vuln / Auth | SAST/DAST or dependency audit |
| Frontend | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
- Data Handling: Sanitize all user inputs to prevent Injection attacks. Never log raw PII
- Secrets Management: No hardcoded API keys. Use Env Vars/Secrets Manager
- Authorization: Validate user permissions before state changes
2. Performance & Resources
- Execution Efficiency: Consider time complexity for algorithms
- Memory Management: Use streams/pagination for large data
- Resource Cleanup: Close DB connections/file handlers in finally blocks
3. Architecture & Scalability
- Design Pattern: Follow SOLID principles, use Dependency Injection
- Modularity: Decouple logic from UI/Frameworks
4. Observability & Reliability
- Logging Standards: Structured JSON, include trace IDs
request_id - Metrics: Track
error_rate,latency,queue_depth - Error Handling: Standardized error codes, no bare except
- Observability Artifacts:
- Log Fields: timestamp, level, message, request_id
- Metrics: request_count, error_count, response_time
- Dashboards/Alerts: High Error Rate > 5%
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
- Tests passed + coverage met
- Lint/Typecheck passed
- Logging/Metrics/Trace implemented
- Security checks passed
- Documentation/Changelog updated
- Accessibility/Performance requirements met (if frontend)
Anti-patterns / Pitfalls
- ⛔ Don't: Log PII, catch-all exception, N+1 queries
- ⚠️ Watch out for: Common symptoms and quick fixes
- 💡 Instead: Use proper error handling, pagination, and logging
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: AmnadTaowsoam/CerebraSkills — distributed by TomeVault.
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需手动接入
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Node.js · Python >=3.8
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
# Inputs / Outputs / Contracts
* **Inputs**:
- Local datasets on client devices (never transmitted to server)
- Model architecture and hyperparameters
- Privacy budget parameters (epsilon, delta)
- Client selection criteria and participation requirements
* **Entry Conditions**: (Select at least one profile to enable specific modules) [ ] DevOps [x] Backend
This skill covers the implementation of privacy-preserving machine learning techniques that enable training models on distributed, sensitive data without exposing raw data. It includes Federated Learning for distributed training, Homomorphic Encryption for…
Data Privacy: Enables ML on sensitive data without privacy violations Regulatory Compliance: Meets GDPR, HIPAA, and other data protection regulations Collaborative Learning: Multiple organizations can collaborate without sharing data
Core Concepts & Rules
Follow established patterns and conventions Maintain consistency across codebase Document decisions and trade-offs
Start with the simplest viable solution Iterate based on feedback and requirements Test thoroughly before deployment
# Federated Learning Homomorphic
## Skill Profile
*(Select at least one profile to enable specific modules)*
- [ ] **DevOps**
- [x] **Backend**
- [ ] **Frontend**
- [ ] **AI-RAG**
- [ ] **Security Critical**
## Overview
This skill covers the implementation of privacy-preserving machine learning techniques that enable training models on distributed, sensitive data without exposing raw data. It includes Federated Learning for distributed training, Homomorphic Encryption for computation on encrypted data, and Secure Multi-Party Computation (SMPC) for collaborative computation.
## Why This Matters
- **Data Privacy**: Enables ML on sensitive data without privacy violations
- **Regulatory Compliance**: Meets GDPR, HIPAA, and other data protection regulations
- **Collaborative Learning**: Multiple organizations can collaborate without sharing data
---
## Core Concepts & Rules
### 1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
### 2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
## Inputs / Outputs / Contracts
* **Inputs**:
- Local datasets on client devices (never transmitted to server)
- Model architecture and hyperparameters
- Privacy budget parameters (epsilon, delta)
- Client selection criteria and participation requirements
* **Entry Conditions**:
- TensorFlow Federated or PySyft installed
- HE library (SEAL/TenSEAL) configured
- Client devices with local data available
- Secure communication channels established (TLS 1.3)
* **Outputs**:
- Trained global model
- Client participation metrics and contribution tracking
- Privacy loss accounting reports
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Skill Profile → Overview → Why This Matters → Core Concepts & Rules → 1. Core Principles → 2. Implementation Guidelines
要点 -> DevOps · Backend · Frontend · AI-RAG · Security Critical · Data Privacy · Regulatory Compliance · Collaborative Learning
文件/命令 -> .env.example · APIKEY · DATABASEURL · requestid · errorrate · latency · queuedepth
内容 SHA-256 -> a3091778a30a
方法与流程
适用与边界
原文中的明确线索
.env.example、APIKEY、DATABASEURL、requestid、errorrate、latency、queuedepth