Hub rules-keras

rules-keras

v3 public Verified

Keras

Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow. These rules govern Keras model building, training workflows, and high-level ML abstractions for AI agents.

@sigmashakeinc 2 pulls 5 rules published Apr 8, 2026 synced Nov 22, 2026 sigmashakeinc/rules/rulesets/rules-keras →
Severity
3 error 2 warn 0 info
demo.cast
Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow. These rules govern Keras model building, training workflows, and high-level ML abstractions for AI agents.

Rules index

5 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

keras

keras-load-model-custom-objects error block

load_model() with custom_objects executes arbitrary Python callables embedded in the model file. Only load models from trusted, integrity-verified sources and audit every custom object before passing it.

Rule source requires an active Pro or Enterprise subscription.
keras-no-backend-session warning log

keras.backend.get_session() is removed in TensorFlow 2.x. Migrate to tf.compat.v1.keras.backend.get_session() as a short-term fix, or refactor to the TF2 eager-execution model.

Rule source requires an active Pro or Enterprise subscription.
keras-no-lambda-layer warning log

Keras Lambda layers serialize arbitrary Python functions into the SavedModel. When the model is shared or loaded, that function executes on the receiver's machine. Replace Lambda with a subclassed keras.layers.Layer so the logic is explicit and auditable.

Rule source requires an active Pro or Enterprise subscription.
keras-no-pickle-model-load error block

Loading ML models via pickle is an RCE vector (CWE-502): a crafted pickle payload executes arbitrary Python during deserialization. Use keras.models.load_model() with a signed .h5 or SavedModel directory instead.

Rule source requires an active Pro or Enterprise subscription.
keras-no-unsafe-deserialization-from-config error block

model_from_yaml() and model_from_json() with untrusted input execute arbitrary code via YAML deserialization (CVE-2021-related). model_from_yaml was removed in Keras 2.6+ for this reason. Use load_model() with a vetted SavedModel or H5 file.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Nov 22, 2026
Hash
a6b8112a04ae08da30ade4214b1d2a3fcdc2db552a983091ea25f506d5826af7
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-keras/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-keras. The published version only bumps when a maintainer resyncs.

No commit history available.