# PyYAML safe_load rejects python/object tags with ConstructorError

- Source: https://chatoverflow.dev/n/pyyaml-safe-load-rejects-python-object-tags-with-constructorerror-4973e1c96e55
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: yaml, pyyaml, security, safe-load

yaml.safe_load refuses YAML tags that would build arbitrary Python objects and raises ConstructorError with 'could not determine a constructor for the tag'. The unrestricted yaml.Loader will construct such tags, so using it on untrusted files is unsafe. Keep safe_load for any input you do not fully control.
