Skip to content

A Rust library implementing the C2PA standard for ML asset provenance, enabling tracking and verification of machine learning models and datasets throughout their lifecycle.

License

Notifications You must be signed in to change notification settings

IntelLabs/atlas-c2pa-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Atlas C2PA Library

GitHub License Crates.io Documentation OpenSSF Scorecard

Atlas C2PA Library is a Rust implementation for integrating C2PA (Coalition for Content Provenance and Authenticity) standards into machine learning workflows. This library enables cryptographically verifiable ML asset provenance, helping to establish trust in the AI ecosystem.

🌟 Features

  • Complete C2PA Compliance: Create, sign, and verify manifests according to C2PA specifications
  • ML-Specific Extensions: Specialized types for models, datasets, and training processes
  • Framework Support: Works with TensorFlow, PyTorch, ONNX, and other major ML frameworks
  • Secure Provenance: Cryptographic verification of asset origin and lineage
  • Transparent Lineage: Track datasets and components used to create models
  • Governance Controls: DoNotTrain assertions to control asset usage permissions

πŸ“¦ Installation

Add Atlas C2PA Library to your Cargo.toml:

[dependencies]
atlas-c2pa-lib = "0.1.2"

πŸš€ Quick Start

Creating a Model Manifest

use atlas_c2pa_lib::ml::types::{ModelInfo, MLFramework, ModelFormat};
use atlas_c2pa_lib::ml::manifest::MLManifestBuilder;

// Define model information
let model_info = ModelInfo {
    name: "bert-base".to_string(),
    version: "1.0.0".to_string(),
    framework: MLFramework::PyTorch,
    format: ModelFormat::TorchScript,
};

// Create and build a manifest
let manifest = MLManifestBuilder::new(
    model_info,
    "0123456789abcdef0123456789abcdef".to_string(), // Model hash
)
.with_title("BERT Language Model".to_string())
.build()
.unwrap();

Adding DoNotTrain Assertions

use atlas_c2pa_lib::assertion::{Assertion, DoNotTrainAssertion};

// Create a DoNotTrain assertion
let do_not_train = DoNotTrainAssertion {
    reason: "This dataset contains licensed content".to_string(),
    enforced: true,
};

// Convert to assertion type
let assertion = Assertion::DoNotTrain(do_not_train);

Including Dataset Ingredients

use atlas_c2pa_lib::ml::ingredient::create_dataset_ingredient;
use atlas_c2pa_lib::ml::manifest::MLManifestBuilder;
use atlas_c2pa_lib::ml::types::{ModelInfo, MLFramework, ModelFormat};

// Create model info
let model_info = ModelInfo {
    name: "text-classifier".to_string(),
    version: "2.0".to_string(),
    framework: MLFramework::TensorFlow,
    format: ModelFormat::SavedModel,
};

// Create dataset ingredient
let dataset = create_dataset_ingredient(
    "Wikipedia-EN-2023",
    "https://example.com/datasets/wiki2023.zip",
    "0123456789abcdef0123456789abcdef", // Dataset hash
);

// Build model manifest with dataset
let manifest = MLManifestBuilder::new(
    model_info,
    "fedcba9876543210fedcba9876543210".to_string(), // Model hash
)
.with_dataset(dataset)
.build()
.unwrap();

πŸ“‹ Use Cases

  • Model Cards: Enhance model documentation with verifiable provenance information
  • Dataset Verification: Ensure datasets come from trustworthy sources and are unmodified
  • Training Transparency: Document training parameters, metrics, and dataset usage
  • Supply Chain Security: Verify the origin and integrity of model components

πŸ“š Documentation

For comprehensive documentation, visit docs.rs/atlas-c2pa-lib.

πŸ§ͺ Examples

The repository includes several examples demonstrating common usage patterns:

  • Creating manifests for models and datasets
  • Adding assertions about model capabilities and limitations
  • Signing and validating manifests
  • Linking related assets with cross-references

πŸ”§ Requirements

  • Rust 1.70.0 or higher

πŸ‘₯ Contributing

Contributions are welcome! Please see our Contributing Guide for details.

πŸ“„ License

This project is licensed under the Apache License, Version 2.0.

πŸ”— Related Projects

Disclaimer

This code in this repo is not stable yet, and should not be used in production environments.


Developed by Intel Labs to advance transparency and trust in AI systems.

About

A Rust library implementing the C2PA standard for ML asset provenance, enabling tracking and verification of machine learning models and datasets throughout their lifecycle.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 5