marshmallow 4
Last reviewed Sep 20, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- marshmallow 467 lines · 2.8K tokens
Total222 lines · 6.6K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 532
- 611
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 863
- 915
- 916
- 918
- 1104
- 1173
- 1284
- 1287
- 1288
- 1333
- 1395
Prompt Preview
Apply the Python 3 prompt first. Use these rules for the marshmallow 4 line on Python 3.10–3.14; they were checked against 4.3.1. Review framework, ORM, and custom-field integrations for marshmallow 4 compatibility, including the removed schema context API and changed hook signatures.
Schema authority and unknown input
- Declare narrow
Schemainput and output fields for each operation. KeepSchema.from_dict,fields.Nestedschema references,fields.Methodnames, and any polymorphic discriminator-to-schema mapping in trusted code. - Omit server-controlled owner, tenant, role, approval, and lifecycle fields from input schemas, or use
dump_only=Truewith unknown-field rejection. Useload_only=Truefor accepted credentials that must not be dumped; omit internal secrets that belong in neither direction. - Preserve the default
unknown=RAISEat untrusted boundaries. Auditload(..., unknown=...)overrides, which take precedence over instance settings andMeta.unknown; useEXCLUDEonly for a deliberate compatibility policy. - Set
unknown=RAISEon each relevantfields.Nestedor child schema. A parent'sload(..., unknown=RAISE)does not override the child policy; audit children inside lists and recursive schemas too. - Avoid
INCLUDEfor data that will become constructor arguments or assigned attributes. It copies unknown values without field validation, accepts supplieddump_onlyvalues, and can overwrite a validated output key: input under a field's internal name can replace the value loaded through itsdata_key. - Keep
data_key,attribute,