Hub rules-tensorflow

rules-tensorflow

v3 public Verified

TensorFlow

TensorFlow is a comprehensive open-source platform for machine learning and artificial intelligence. These rules govern model loading safety, computational resource management, and API best practices for AI agents.

@sigmashakeinc 2 pulls 6 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-tensorflow →
Severity
3 error 3 warn 0 info
demo.cast
TensorFlow is a comprehensive open-source platform for machine learning and artificial intelligence. These rules govern model loading safety, computational resource management, and API best practices for AI agents.

Rules index

6 governance rules

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

tensorflow

tensorflow-block-unsafe-patterns warning ask

Potentially unsafe pattern detected in tensorflow code: "tf.py_function". Review the use case — this may indicate a security risk, a deprecated API, or a misconfiguration. Confirm the write is intentional.

Rule source requires an active Pro or Enterprise subscription.
tensorflow-force-updated-api warning log

You are using an outdated API for tensorflow. Please upgrade to the newer API.

Rule source requires an active Pro or Enterprise subscription.
tensorflow-no-allow-pickle error block

RISK: allow_pickle=True in numpy.load() or similar calls re-enables Python object deserialization, which executes arbitrary code embedded in the .npy/.npz file. FIX: keep allow_pickle=False (the default since NumPy 1.16.3) and use only structured dtypes. If you need object arrays, validate the source is internal/signed.

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

RISK: Keras Lambda layers serialize the Python function bytecode inside the model file. Loading such a model from an untrusted source executes that bytecode (CWE-502). FIX: replace Lambda layers with named custom Keras Layer subclasses, which serialize only configuration — not arbitrary code.

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

RISK: Loading a Keras/SavedModel from an HTTP URL fetches and deserializes untrusted model weights — any model checkpoint can contain malicious Lambda layers or pickle objects that execute on load. FIX: download the artifact to a local path, verify its SHA-256 checksum against a trusted manifest, then load from the local path.

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

RISK: pickle.load() executes arbitrary Python bytecode during deserialization — loading a model checkpoint or dataset from an untrusted or user-supplied path is a remote-code-execution vector (CWE-502). FIX: use tf.saved_model.load() or keras.models.load_model() for model artifacts; for data, use numpy .npy/.npz or tf.data.TFRecordDataset.

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
Oct 11, 2026
Hash
04c3361552a10fe9a0b44bd9c1d0da179fe5549c4e39e74802825bf4ce8d3689
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

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

No commit history available.