c2.6 Import models safely with Safetensors, not pickle
When importing a model customized elsewhere, use the Safetensors serialization format so untrusted artifacts cannot execute code on load.
Implementation guidance
How to implement on AWS
Use Amazon Bedrock Custom Model Import with Safetensors as the serialization format. Unlike pickle, Safetensors stores only tensor data (no arbitrary Python objects), eliminating code-execution risk from untrusted files. Validate the provenance of imported models.
Acceptance criteria
Imported models use Safetensors; no pickle-based artifacts are accepted; model provenance is recorded.
Practical implementation
How this control is implemented in each reference architecture:
Imported models enter through the Generative AI account only as Safetensors, with provenance recorded and pickle artifacts rejected before import.
- Use Amazon Bedrock Custom Model Import and accept only the Safetensors serialization format, which stores tensors without executable Python objects.
- Reject pickle-based artifacts at the ingestion step and record the model's provenance (source, hash, approver) before import.
- Store approved import artifacts in a controlled bucket and log every import to the Log archive.
How to validate: Imported models are Safetensors; a pickle artifact is refused; provenance is recorded and the import is logged.
Avoid: Importing a pickle checkpoint from an untrusted source. Unpickling can execute arbitrary code; require Safetensors and verify provenance.
Model imports in the account are restricted to Safetensors with recorded provenance, so an untrusted artifact cannot execute code on load.
- Use Bedrock Custom Model Import with Safetensors only; do not accept pickle-format artifacts.
- Record provenance (source, hash, approver) and store approved artifacts in a controlled bucket.
- Log every import to the in-account log bucket.
How to validate: Imports are Safetensors; pickle artifacts are refused; provenance is recorded and imports are logged.
Avoid: Loading community checkpoints in pickle format directly. Convert to and require Safetensors, and verify where the model came from.
Threats addressed
- Arbitrary code execution from unpickling an untrusted model artifact.
- Supply-chain compromise via a tampered imported model.
AWS services
Framework mappings
OWASP GenAI/LLM Top 10 (2026)
- LLM04 Supply Chain
- LLM05 Data and Model Poisoning
NIST AI Risk Management Framework (AI 100-1)
- GOVERN.6 Policies for third-party software, data and supply chain risk
- MAP.4 Risks and impacts are mapped
- MANAGE.3 Third-party risks and benefits are managed
AWS Well-Architected Generative AI Lens (Security)
- GENSEC06-BP01 Implement data purification filters for model training workflows
Learning resources
References
- AWS SRA for AI — Capability 2, Rationale
AI Security Maturity Model