{"id":26999820,"url":"https://github.com/scimorph/secureml","last_synced_at":"2026-04-07T08:32:12.111Z","repository":{"id":285837178,"uuid":"951408758","full_name":"scimorph/secureml","owner":"scimorph","description":"Easy-to-use utilities to build privacy-preserving AI.","archived":false,"fork":false,"pushed_at":"2026-02-11T16:52:01.000Z","size":3054,"stargazers_count":24,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-21T21:07:04.621Z","etag":null,"topics":["ai","click","compliance","federated-learning","flower","gdpr","hashicorp-vault","jinja2","ml","numpy","opacus","pandas","privacy","python","pytorch","sdv","tensorflow","weasyprint","yaml"],"latest_commit_sha":null,"homepage":"https://secureml.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scimorph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-19T16:22:28.000Z","updated_at":"2026-01-26T20:51:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"592a8eb8-027d-4698-bf05-1732fe22aeae","html_url":"https://github.com/scimorph/secureml","commit_stats":null,"previous_names":["scimorph/secureml"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/scimorph/secureml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scimorph%2Fsecureml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scimorph%2Fsecureml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scimorph%2Fsecureml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scimorph%2Fsecureml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scimorph","download_url":"https://codeload.github.com/scimorph/secureml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scimorph%2Fsecureml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31506562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","click","compliance","federated-learning","flower","gdpr","hashicorp-vault","jinja2","ml","numpy","opacus","pandas","privacy","python","pytorch","sdv","tensorflow","weasyprint","yaml"],"created_at":"2025-04-04T03:17:55.563Z","updated_at":"2026-04-07T08:32:12.104Z","avatar_url":"https://github.com/scimorph.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/scimorph/secureml/blob/master/secureml_logo_2-.png\" alt=\"SecureML Logo\" width=\"500\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/scimorph/secureml/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/scimorph/secureml/ci.yml?branch=master\u0026label=CI/CD\u0026logo=github\" alt=\"CI/CD Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/scimorph/secureml/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/scimorph/secureml/ci.yml?branch=master\u0026label=tests\u0026logo=pytest\" alt=\"Tests Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/secureml/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/secureml.svg\" alt=\"PyPI Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/scimorph/secureml/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/scimorph/secureml\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/secureml.svg\" alt=\"Python Versions\"\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\n  \u003ca href=\"https://secureml.readthedocs.io/en/latest/index.html\"\u003eDocumentation\u003c/a\u003e\n\u003c/h3\u003e\n\nSecureML is an open-source Python library that integrates with popular machine learning frameworks like TensorFlow and PyTorch. It provides developers with easy-to-use utilities to ensure that AI agents handle sensitive data in compliance with data protection regulations.\n\n## Key Features\n\n- **Data Anonymization Utilities**:\n  - K-anonymity implementation with adaptive generalization\n  - Pseudonymization with format-preserving encryption\n  - Configurable data masking with statistical property preservation\n  - Hierarchical data generalization with taxonomy support\n  - Automatic sensitive data detection\n- **Privacy-Preserving Training Methods**: \n  - Differential privacy integration with PyTorch (via Opacus) and TensorFlow (via TF Privacy)\n  - Federated learning with Flower, allowing training on distributed data without centralization\n  - Support for secure aggregation and privacy-preserving federated learning\n- **Compliance Checkers**: Tools to analyze datasets and model configurations for potential privacy risks\n- **Synthetic Data Generation**: \n  - Multiple generation methods including statistical modeling, GANs, and copulas\n  - SDV integration with Gaussian Copula, CTGAN, and TVAE synthesizers\n  - Automatic sensitive data detection and special handling\n  - Preservation of statistical properties and correlations between variables\n  - Support for mixed data types (numeric, categorical, datetime)\n  - Configurable privacy-utility tradeoff controls\n  - Tabular data synthesis with relation preservation\n- **Regulation-Specific Presets**: \n  - Pre-configured YAML settings aligned with major regulations (GDPR, CCPA, HIPAA, LGPD)\n  - Detailed compliance requirements for each regulation\n  - Customizable identifiers for personal data and sensitive information\n  - Integration with compliance checking functionality\n- **Audit Trails and Reporting**: \n  - Comprehensive audit logging of data access, transformations, and model operations\n  - Detailed event tracking for privacy-related operations with timestamps and contexts\n  - Function-level auditing through decorators\n  - Automated compliance reports in HTML and PDF formats\n  - Visual dashboards with charts showing privacy metrics and event distributions\n  - Integration with compliance checkers for continuous monitoring\n\n## Installation\n\nWith pip (Python 3.11-3.12):\n```bash\npip install secureml\n```\n### Optional Dependencies\n\n```bash\n# For generating PDF reports for compliance and audit trails\npip install secureml[pdf]\n\n# For secure key management with HashiCorp Vault\npip install secureml[vault]\n\n# For all optional components\npip install secureml[pdf,vault]\n```\n\n## Quick Start\n\n### Data Anonymization\n\nAnonymizing a dataset to comply with privacy regulations:\n\n```python\nimport pandas as pd\nfrom secureml import anonymize\n\n# Load your dataset\ndata = pd.DataFrame({\n    \"name\": [\"John Doe\", \"Jane Smith\", \"Bob Johnson\"],\n    \"age\": [32, 45, 28],\n    \"email\": [\"john.doe@example.com\", \"jane.smith@example.com\", \"bob.j@example.com\"],\n    \"ssn\": [\"123-45-6789\", \"987-65-4321\", \"456-78-9012\"],\n    \"zip_code\": [\"10001\", \"94107\", \"60601\"],\n    \"income\": [75000, 82000, 65000]\n})\n    \n# Anonymize using k-anonymity\nanonymized_data = anonymize(\n    data,\n    method=\"k-anonymity\",\n    k=2,\n        sensitive_columns=[\"name\", \"email\", \"ssn\"]\n    )\n    \n    print(anonymized_data)\n```\n\n### Compliance Checking with Regulation Presets\n\nSecureML includes built-in presets for major regulations (GDPR, CCPA, HIPAA, LGPD) that define the compliance requirements specific to each regulation:\n\n```python\nimport pandas as pd\nfrom secureml import check_compliance\n    \n# Load your dataset\ndata = pd.read_csv(\"your_dataset.csv\")\n    \n# Model configuration\nmodel_config = {\n    \"model_type\": \"neural_network\",\n    \"input_features\": [\"age\", \"income\", \"zip_code\"],\n    \"output\": \"purchase_likelihood\",\n    \"training_method\": \"standard_backprop\"\n}\n    \n# Check compliance with GDPR\nreport = check_compliance(   \n    data=data,\n    model_config=model_config,\n    regulation=\"GDPR\"\n)\n    \n# View compliance issues\nif report.has_issues():\n    print(\"Compliance issues found:\")\n    for issue in report.issues:\n        print(f\"- {issue['component']}: {issue['issue']} ({issue['severity']})\")\n        print(f\"  Recommendation: {issue['recommendation']}\")\n\n```\n\n### Privacy-Preserving Machine Learning\n\nTrain a model with differential privacy guarantees:\n\n```python\nimport torch.nn as nn\nimport pandas as pd\nfrom secureml import differentially_private_train\n    \n# Create a simple PyTorch model\nmodel = nn.Sequential(\n    nn.Linear(10, 64),\n    nn.ReLU(),\n    nn.Linear(64, 2),\n    nn.Softmax(dim=1)\n)\n    \n# Load your dataset\ndata = pd.read_csv(\"your_dataset.csv\")\n    \n# Train with differential privacy\nprivate_model = differentially_private_train(\n    model=model,\n    data=data,\n    epsilon=1.0,  # Privacy budget\n    delta=1e-5,   # Privacy delta parameter\n    epochs=10,\n    batch_size=64\n)\n```\n\n### Synthetic Data Generation\n\nGenerate synthetic data that maintains the statistical properties of the original data:\n\n```python\nimport pandas as pd\nfrom secureml import generate_synthetic_data\n    \n# Load your dataset\ndata = pd.read_csv(\"your_dataset.csv\")\n    \n# Generate synthetic data\nsynthetic_data = generate_synthetic_data(\n    template=data,\n    num_samples=1000,\n    method=\"statistical\",  # Options: simple, statistical, sdv-copula, gan\n    sensitive_columns=[\"name\", \"email\", \"ssn\"]\n)\n    \nprint(synthetic_data.head())\n```\n\n## Documentation\n\nFor detailed documentation, examples, and API reference, visit [our documentation](https://secureml.readthedocs.io).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request or Issue.\nOur focus is expanding supported legislations beyond GDPR, CCPA, HIPAA, and LGPD. You can help us with that!\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscimorph%2Fsecureml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscimorph%2Fsecureml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscimorph%2Fsecureml/lists"}