Secrets, Keys and Model Artifact Protection

5 minutes 5 Questions

Secrets, keys, and model artifact protection is a core discipline within AI security management that safeguards the sensitive assets underpinning AI systems. Secrets include API tokens, database credentials, cloud service keys, and service-account passwords that AI pipelines use to access data, compute, and third-party services. Keys refer to cryptographic material such as encryption keys, signing keys, and TLS certificates. Model artifacts encompass trained weights, checkpoints, fine-tuning adapters, embeddings, tokenizers, configuration files, and training datasets—intellectual property that is costly to produce and dangerous if stolen, poisoned, or tampered with. Protection begins with eliminating hard-coded secrets from notebooks, scripts, container images, and repositories, replacing them with centralized secret managers (e.g., HashiCorp Vault, AWS Secrets Manager, Azure Key Vault) that provide dynamic, short-lived credentials, automated rotation, and audited access. Keys should be generated and stored in Hardware Security Modules or cloud KMS services, with envelope encryption protecting data at rest and strict separation of duties over key administration. Model artifacts require confidentiality, integrity, and provenance controls. Encrypt artifacts at rest and in transit, store them in access-controlled model registries, and enforce least-privilege, role-based access for data scientists, MLOps engineers, and inference services. Integrity is maintained through cryptographic hashing and digital signing (e.g., Sigstore, in-toto attestations), enabling verification before deployment and detecting supply-chain tampering or malicious pickle-based payloads. Software Bills of Materials and model cards document lineage and dependencies. Runtime protections include confidential computing enclaves to shield weights during inference, watermarking and fingerprinting to prove ownership and detect theft, rate limiting to counter model extraction, and secrets scanning in CI/CD to prevent leakage. Comprehensive logging, anomaly detection on artifact access, and incident response playbooks for key compromise complete the control set. Together, these measures align with frameworks such as NIST AI RMF, ISO/IEC 42001, and OWASP LLM Top 10, reducing risks of data breach, IP loss, model poisoning, and unauthorized inference.

Secrets, Keys and Model Artifact Protection (ISACA AAISM – AI Technologies and Controls)

Why This Topic Matters
In the ISACA Advanced in AI Security Management (AAISM) body of knowledge, the domain AI Technologies and Controls expects candidates to understand that an AI system is only as secure as the credentials, cryptographic material and trained artifacts that sit behind it. API keys to foundation models, cloud service credentials, encryption keys protecting training data, and the model weights themselves are high-value targets. A leaked API key can lead to runaway inference costs or unauthorized data exposure; a stolen model file represents theft of intellectual property that may have cost millions to train; a tampered model artifact can silently introduce backdoors or poisoned behaviour into production. Exam questions in this area test whether you can identify the right control for the right asset at the right lifecycle stage, and whether you think like a security manager rather than an engineer.

What It Is
Secrets are any sensitive values that grant access or enable functionality: API keys for LLM providers, database connection strings, OAuth tokens, service-account credentials, webhook signing secrets, and passwords embedded in pipelines or notebooks.
Keys refers to cryptographic key material: symmetric keys used to encrypt datasets and model files at rest, asymmetric key pairs used for signing artifacts and authenticating services, and the key-encryption keys (KEKs) that protect them in a hierarchy.
Model artifacts are the outputs of the ML lifecycle: trained weights and checkpoints, serialized model files (for example pickle, ONNX, SavedModel, safetensors), tokenizers, embeddings, fine-tuning adapters (such as LoRA weights), prompt templates and system prompts, feature stores, and the metadata and lineage records that describe them.

Protection of these assets spans confidentiality (preventing theft or exposure), integrity (preventing tampering or substitution), and availability (ensuring keys and models can be recovered and rotated without outage).

How It Works – Core Controls
1. Centralized secrets management. Secrets should never be hard-coded in source, notebooks, container images, or configuration files committed to repositories. They belong in a dedicated vault or cloud secrets manager (for example HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager) that provides access control, audit logging, versioning and automated rotation. Applications retrieve secrets at runtime through identity-based authentication (workload identity, IAM roles) rather than through long-lived static credentials.
2. Least privilege and scoping. Each API key or service account should be scoped to the minimum models, endpoints, regions and operations required. Separate keys for development, test and production prevent a lower-environment leak from compromising production. Usage quotas and spend limits on model API keys act as a blast-radius control.
3. Rotation and revocation. Secrets and keys must have defined lifetimes. Automated rotation reduces the window of exposure; a documented revocation process ensures a compromised key can be disabled rapidly. Short-lived tokens are preferred over permanent keys.
4. Detection of leakage. Pre-commit hooks and repository scanners detect secrets before they are pushed; continuous scanning of code, logs, container images, model cards and public repositories catches accidental exposure. Logging must be configured so that prompts, API keys and tokens are redacted rather than written to plaintext logs.
5. Cryptographic key management. Keys are generated, stored and used within a Hardware Security Module (HSM) or cloud Key Management Service (KMS) so that private key material is never exposed to application memory in plaintext. A key hierarchy (data keys wrapped by KEKs) enables envelope encryption of large datasets and model files. Separation of duties ensures no single individual can both administer keys and access the data they protect. Key lifecycle phases—generation, distribution, storage, use, rotation, archival, destruction—must each be governed. Customer-managed keys (CMK/BYOK) give the organization control when using third-party AI platforms.
6. Model artifact confidentiality. Model weights should be encrypted at rest in the model registry and object storage, encrypted in transit, and accessible only through role-based access controls tied to the registry. Access to download weights should be logged and reviewed. For high-value proprietary models, additional measures include confidential computing (trusted execution environments) during inference, model watermarking or fingerprinting to prove ownership of stolen copies, and rate limiting on inference endpoints to resist model-extraction attacks.
7. Model artifact integrity. Every artifact promoted toward production should be hashed and cryptographically signed; deployment pipelines verify the signature before loading the model. This prevents substitution of a backdoored model and establishes provenance. Avoid insecure serialization formats that execute arbitrary code on load (pickle is the classic example) in favour of safer formats such as safetensors, or scan untrusted model files before loading. A Software Bill of Materials extended to AI (AI-BOM or ML-BOM) records datasets, base models, libraries and their versions so dependencies can be traced.
8. Registry and supply chain governance. A model registry acts as the system of record with versioning, immutable storage, approval gates and lineage back to training data and code. Third-party or open-source models pulled from public hubs must be verified against publisher signatures and checksums, pinned to specific versions, and scanned for malicious content.
9. Protection of prompts and configuration. System prompts, guardrail rules and retrieval configurations are increasingly treated as sensitive artifacts because their disclosure enables prompt-injection and jailbreak tuning. They should be version controlled with restricted access and should never contain embedded secrets.
10. Monitoring, audit and incident response. Centralized audit trails for secret retrieval, key use and model download feed detection rules (for example a key used from an unexpected region, or a bulk download of checkpoints). Incident runbooks define how to revoke keys, re-sign and redeploy clean models, and assess whether exposed secrets grant access to training data containing personal information, which may trigger breach notification obligations.

Mapping to Frameworks
Candidates should connect these controls to the frameworks ISACA references: NIST AI RMF (Manage and Govern functions emphasise provenance, access control and supply-chain integrity), ISO/IEC 42001 and ISO/IEC 27001 Annex A controls on cryptography, access control and secure development, OWASP Top 10 for LLM Applications (notably Supply Chain Vulnerabilities, Sensitive Information Disclosure and Model Theft), and MITRE ATLAS techniques such as ML model exfiltration and supply-chain compromise.

Exam Tips: Answering Questions on Secrets, Keys and Model Artifact Protection
Tip 1 – Identify the asset first. Determine whether the question is about a credential (secret), cryptographic material (key) or a trained artifact (model). The best answer usually matches the control to the asset type: vaults and rotation for secrets; HSM/KMS and separation of duties for keys; signing, hashing and registry controls for model artifacts.
Tip 2 – Distinguish confidentiality from integrity. If the scenario describes theft, exfiltration or exposure, favour encryption, access control, watermarking and confidential computing. If it describes tampering, substitution, backdoors or poisoned downloads, favour signing, hash verification, provenance records and secure serialization.
Tip 3 – Prefer preventive, centralized, automated controls. ISACA exams reward answers that remove the root cause. 'Store the key in a secrets manager with automated rotation and workload identity' beats 'instruct developers not to commit keys' or 'review repositories quarterly.' Awareness training and manual reviews are valid but rarely the best answer when a technical preventive control is available.
Tip 4 – Apply least privilege and separation of duties. When options involve who can access keys or models, look for scoped, role-based, per-environment access and separation between key administrators and data users.
Tip 5 – Think lifecycle. Questions may ask what is missing from a process. Check for all key lifecycle phases—especially rotation, revocation and destruction—which are commonly omitted. For models, check for verification at promotion and load time, not only at creation.
Tip 6 – Watch for insecure defaults. Loading an unverified pickle file from a public hub, logging full prompts with embedded tokens, hard-coding an LLM API key in a notebook, or sharing one production key across teams are red flags. The correct answer usually addresses the specific insecure practice named.
Tip 7 – Consider the manager's perspective. AAISM is a management certification. When asked about the first or most important step, governance-oriented answers such as classifying model artifacts as critical assets, defining ownership, or establishing policy and registry requirements often precede purely technical fixes. When asked for the most effective control against a specific threat, choose the targeted technical control.
Tip 8 – Third-party AI services. For questions about external model providers, look for customer-managed keys, contractual data-handling and key-ownership clauses, scoped API credentials with spend limits, and verification of vendor signatures on downloaded models.
Tip 9 – Incident scenarios. If a key or model is confirmed compromised, the sequence is typically: revoke/rotate immediately, assess scope via audit logs, verify integrity of deployed artifacts, re-sign and redeploy clean versions, and evaluate regulatory notification duties. Avoid answers that begin with lengthy investigation before containment.
Tip 10 – Eliminate distractors. Options that only address a symptom (for example 'increase logging' without acting on it), that rely solely on obscurity (for example renaming model files), or that apply a control to the wrong asset (for example watermarking an API key) can be discarded quickly.

Quick Review Checklist
• Secrets in a vault, never in code, images or logs; retrieved via workload identity.
• Scoped, per-environment keys with quotas, automated rotation and rapid revocation.
• Cryptographic keys generated and used inside HSM/KMS; envelope encryption; separation of duties; full lifecycle governance.
• Model artifacts encrypted at rest and in transit, access-controlled in a registry with logging.
• Hash and sign every artifact; verify at deployment and load; avoid code-executing serialization formats.
• Maintain AI-BOM and lineage; verify third-party models by signature and version pinning.
• Protect system prompts and configurations as sensitive artifacts.
• Monitor for anomalous key use and bulk model downloads; maintain incident runbooks.
• Align with NIST AI RMF, ISO/IEC 42001, ISO/IEC 27001, OWASP LLM Top 10 and MITRE ATLAS.
Test mode:

AAISM - Secrets, Keys and Model Artifact Protection Example Questions

Test your knowledge of Secrets, Keys and Model Artifact Protection

Question 1

What is the PRIMARY security benefit of applying a digital signature to model weights and related artifacts before they are promoted from a model registry into production?

Question 2

A penetration test finds that an inference container image in a shared internal registry contains a long-lived access key. The service uses that key to pull and decrypt production model weights from the artifact store. The model team proposes rotating the key and redeploying the image. Which control BEST addresses the underlying weakness that allowed this exposure?

Question 3

During a code review, an information security manager learns that a cloud storage access key was committed months ago in a notebook to a shared repository used by several teams. The key grants write access to the model registry holding production model weights, and access logs for that period are incomplete. What should the manager do FIRST?

More Secrets, Keys and Model Artifact Protection questions
21 questions (total)

Other AI Technologies and Controls concepts

AI Architecture Within Enterprise ArchitectureAI Development Life Cycle Security TouchpointsAI System Components and Attack SurfaceAPI Security for AI ServicesArchitecture Review and Security Sign-Off for AIContent Safety Filters and GuardrailsControl Testing, Assurance and Continuous ValidationCross-Border Data Transfer and Residency for AIData Access Controls and Segregation for AI PipelinesData Classification and Handling for AIData Leakage Prevention for AI Inputs and OutputsData Minimization, Anonymization and PseudonymizationData Provenance, Lineage and Labeling ControlsData Quality, Integrity and Validation ControlsData Retention, Deletion and Unlearning RequestsDetection and Response Integration for AI SystemsEncryption of AI Data at Rest, in Transit and in UseEthical Review and Responsible AI AssessmentExplainability and Interpretability ControlsFairness and Bias Testing ControlsFine-Tuning and Prompt Engineering SecurityIdentity and Access Management for Models and DataInput Validation and Prompt Filtering ControlsKill Switches, Circuit Breakers and Fallback ModesLogging, Auditing and Traceability of AI InteractionsMaintenance, Retraining and Drift ResponseMapping Security Controls to AI RiskMLOps and LLMOps Security ControlsModel Cards, Datasheets and AI DocumentationModel Decommissioning and Secure RetirementModel Selection: Build, Buy, Fine-Tune or PromptModel Validation, Testing and Acceptance CriteriaModel Versioning, Change Management and RollbackMonitoring Model Behavior and Anomaly DetectionOutput Filtering, Moderation and ValidationPre-Deployment Security Testing of AI ModelsPreventive, Detective and Corrective Controls for AIPrivacy by Design for AI SystemsPrivacy-Enhancing Technologies for AIRate Limiting, Quotas and Abuse PreventionRisk-Based Human Oversight of AI Inputs and OutputsRobustness and Reliability ControlsSecure Deployment and Release of AI ModelsSecure Deployment: Cloud, On-Premises and Edge AISecure Training Environments and PipelinesSecuring AI Agents, Tools and PluginsSecuring LLM Applications and RAG PipelinesSecurity Architecture Patterns for AI ApplicationsSecurity by Design and Threat-Informed RequirementsSecurity Metrics and Dashboards for AI ControlsSynthetic Data and Its Security ImplicationsTraining Data Security and Integrity ControlsTransparency, Disclosure and User NotificationTrust and Safety Operations for Generative AIZero Trust and Segmentation for AI Workloads