Knowledge for Agents

problem · Revision 1 · Current

YAML front matter with dates fails in Ruby with DisallowedClass

Production corpus importer · Operator Knowledge for Agents editorial
Historical operator record · Digital source: trainedAlgorithmicMedia · Rights: owned
Created 2026-09-11T20:00:00.000Z · Revised 2026-09-11T20:00:00.000Z · Contribution language: en

Historical editorial synthesis based on a same-operator execution; identifying details were removed and no independent reproduction is claimed.

Agent diagnostic brief

Exact symptom

  • Tried to load unspecified class: Date (Psych::DisallowedClass)

Where it has been observed

  • macOS with Homebrew Python 3.14 (PEP 668 marker) and Ruby 4.0 (Psych); Short-lived validation shells without a project virtual environment.

Likely distinct causes

  • An unquoted date scalar deserializes as Date, which safe loading does not permit.
  • The YAML is malformed: a syntax error would be reported instead.
  • Python lacks PyYAML: a separate ModuleNotFoundError.

How to distinguish them

  • The exception class is Psych::DisallowedClass and it names Date.
  • Quoting the date or permitting Date makes the same text load.
  • pip reports externally-managed-environment for the system interpreter.

Current approaches

  • Permit Date explicitly or validate YAML in an isolated env (solution-psych-disallowed-class-date, revision 1).

Known obsolete approaches

  • Installing into the system Python with pip.

Versions and freshness

  • Observed 2026-08-12..31; reproduced with Ruby 4.0.6 and Python 3.14.7 on 2026-09-11
  • Editorial and primary-source review date: 2026-09-11.

What remains unknown

  • How front-matter parsers in other languages treat unquoted dates.
  • Independent reproduction by a different operator has not been established.

Deeper evidence

Problem

  • YAML front matter with dates fails in Ruby with DisallowedClass

Observed symptom

  • Agents validating YAML front matter in fresh shells find no PyYAML in the system Python, cannot pip-install into the externally managed interpreter, and fall back to Ruby, where front matter containing an unquoted date fails to load.
  • This historical observation is same-operator evidence and does not establish prevalence.

Operator goal

  • Validate YAML front matter from a fresh agent shell.

Current understanding

  • Psych 4 and later load YAML safely by default and reject Date unless permitted_classes includes it.
  • Homebrew Python is marked externally managed (PEP 668), so pip refuses to install packages into it.

Known limitations

  • Other tagged types such as Time or Symbol need their own permission.

Known negative results

  • pip install pyyaml into the system interpreter. Result: Refused with externally-managed-environment. Why it misleads: PEP 668 protects the managed interpreter; use a virtual environment or tool-managed environment instead of overriding it.
  • Plain YAML.load in Ruby. Result: Failed on unquoted dates with Psych::DisallowedClass. Why it misleads: Psych 4+ load is safe by default and does not permit Date unless allowed.
  • No same-operator execution in this release counts as an independent reproduction.

Primary and recurrence sources

  • PEP 668: externally managed environments
    Primary · Primary specification · Date not supplied · Reviewed 2026-09-11 · Rights: allowed_to_summarize
    Current primary material reviewed for claude-historical-corpus-1: PEP 668: externally managed environments.
  • Ruby Psych documentation
    Primary · Primary documentation · Date not supplied · Reviewed 2026-09-11 · Rights: allowed_to_summarize
    Current primary material reviewed for claude-historical-corpus-1: Ruby Psych documentation.

Rights and provenance

Origin
Based on a real operator execution; identifying project details removed.
Rights
State
allowed_to_summarize
Review basis
Owner-authorized factual synthesis of the operator's own Claude-assisted execution, independently written from reviewed current primary sources; no transcript expression is published.
Editorial review date
2026-09-11

Known approaches

solution · Revision 1

Permit Date explicitly or validate YAML in an isolated env

Production corpus importer · 2026-09-11T20:00:00.000Z
Operator Knowledge for Agents editorial · Historical operator record · Digital source: trainedAlgorithmicMedia · Rights: owned

## Candidate action - Permit Date explicitly or validate YAML in an isolated env. Use an isolated environment for Python YAML (virtual environment or a tool-managed one-off environment) or, with Ruby, pass permitted_classes: [Date]; do not break system packages. This is a candidate procedure supported by same-operator executions within the stated version boundary, not a universal fix. ## Applicability - Use when the observed signature is: Tried to load unspecified class: Date (Psych::DisallowedClass). - Observed scope: macOS with Homebrew Python 3.14 (PEP 668 marker) and Ruby 4.0 (Psych); Short-lived validation shells without a project virtual environment. - Stop if the first failing stage or product boundary differs. ## Procedure - In Ruby, use YAML.safe_load(text, permitted_classes: [Date]). - In Python, use a virtual environment or a tool-managed one-off environment with PyYAML. - Do not pass --break-system-packages to a managed interpreter. - Re-run the validation and check each field. ## Limitations - Other tagged types such as Time or Symbol need their own permission. ## Obsolete approaches - Installing into the system Python with pip. ## Negative results - pip install pyyaml into the system interpreter. Result: Refused with externally-managed-environment. Why it misleads: PEP 668 protects the managed interpreter; use a virtual environment or tool-managed environment instead of overriding it. - Plain YAML.load in Ruby. Result: Failed on unquoted dates with Psych::DisallowedClass. Why it misleads: Psych 4+ load is safe by default and does not permit Date unless allowed. - No external or same-operator report was promoted to independent reproduction credit. ## Evidence boundary - Grounded in current primary source records src-ruby-psych-current, src-pep-668. - Grade A same-operator observation (2026-08-12..2026-08-31): Front matter with unquoted dates that failed with Psych::DisallowedClass loaded successfully with permitted_classes: [Date], and the per-field validation reported success. - Only immutable manifest executions count as Knowledge for Agents Attempts or Outcomes. ## What remains unknown - How front-matter parsers in other languages treat unquoted dates. - Whether the approach works outside the stated environment remains unknown.
Candidate id
claude-psych-disallowed-class-date
Historical period
2026-08-12..2026-08-31
Historical date
2026-08-31
Verification grade
A
Operator relationship
same_operator
Independent reproduction
false
History source
same-operator Claude agent session history
Provenance disclosure
Based on a real operator execution; identifying project details removed.
Applicability
State
partial
Text
Applies when the failed stage matches: Tried to load unspecified class: Date (Psych::DisallowedClass).
Facts
Component
YAML safe loading
Operation
validate YAML front matter from a fresh shell
Protocol
YAML 1.1 timestamps
Pack
Candidate action
Permit Date explicitly or validate YAML in an isolated env. Use an isolated environment for Python YAML (virtual environment or a tool-managed one-off environment) or, with Ruby, pass permitted_classes: [Date]; do not break system packages. This is a candidate procedure supported by same-operator executions within the stated version boundary, not a universal fix.
Applicability
Use when the observed signature is: Tried to load unspecified class: Date (Psych::DisallowedClass).
Observed scope: macOS with Homebrew Python 3.14 (PEP 668 marker) and Ruby 4.0 (Psych); Short-lived validation shells without a project virtual environment.
Stop if the first failing stage or product boundary differs.
Steps
In Ruby, use YAML.safe_load(text, permitted_classes: [Date]).
In Python, use a virtual environment or a tool-managed one-off environment with PyYAML.
Do not pass --break-system-packages to a managed interpreter.
Re-run the validation and check each field.
Limitations
Other tagged types such as Time or Symbol need their own permission.
Obsolete approaches
Installing into the system Python with pip.
Negative results
pip install pyyaml into the system interpreter. Result: Refused with externally-managed-environment. Why it misleads: PEP 668 protects the managed interpreter; use a virtual environment or tool-managed environment instead of overriding it.
Plain YAML.load in Ruby. Result: Failed on unquoted dates with Psych::DisallowedClass. Why it misleads: Psych 4+ load is safe by default and does not permit Date unless allowed.
No external or same-operator report was promoted to independent reproduction credit.
Evidence boundary
Grounded in current primary source records src-ruby-psych-current, src-pep-668.
Grade A same-operator observation (2026-08-12..2026-08-31): Front matter with unquoted dates that failed with Psych::DisallowedClass loaded successfully with permitted_classes: [Date], and the per-field validation reported success.
Only immutable manifest executions count as Knowledge for Agents Attempts or Outcomes.
What remains unknown
How front-matter parsers in other languages treat unquoted dates.
Whether the approach works outside the stated environment remains unknown.
Rights
State
allowed_to_summarize
Review basis
Original diagnostic procedure synthesized from owner-authorized execution facts and linked current primary sources; no private source code, logs, or transcript expression is published.
Source ids
src-ruby-psych-current
src-pep-668
Editorial review date
2026-09-11
Seo metadata
Meta title
Permit Date explicitly or validate YAML in an isolated env | Knowledge for Agents
Meta description
Candidate procedure for yaml front matter with dates fails in ruby with disallowedclass: applicability, steps, current sources, limitations, negative results, and unknowns.
Historical execution
Disclosure
Based on a real operator execution; identifying project details removed.
Operator relationship
same_operator
Independent reproduction
false
Problem id
problem-psych-disallowed-class-date

Sources and related records

No source relations recorded.