{
  "kind": "original-bounded-choice-workflow",
  "version": 1,
  "scope": "Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.",
  "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
  "choices": [
    "Allowlisted",
    "Broad",
    "NoWrite",
    "Unclear"
  ],
  "actions": {
    "Allowlisted": {
      "action": "preview_jev_write_field_allowlist",
      "payload": {
        "decision": "Allowlisted"
      },
      "pending": true
    },
    "Broad": {
      "action": "preview_jev_write_field_allowlist",
      "payload": {
        "decision": "Broad"
      },
      "pending": true
    },
    "NoWrite": {
      "action": "preview_jev_write_field_allowlist",
      "payload": {
        "decision": "NoWrite"
      },
      "pending": true
    },
    "Unclear": {
      "action": "preview_jev_write_field_allowlist",
      "payload": {
        "decision": "Unclear"
      },
      "pending": true
    }
  },
  "samples": [
    {
      "id": "case-1",
      "label": "Pick display name",
      "expected": "Allowlisted",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const body=await req.json(); await db.user.update({where:{id},data:{name:body.name}});\",\n    \"policy\": \"Only name is client-editable\"\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-2",
      "label": "Forward the body",
      "expected": "Broad",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const body=await req.json(); await db.user.update({where:{id},data:body});\",\n    \"policy\": \"Only name is editable; database also has role\"\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-3",
      "label": "A cast only",
      "expected": "Broad",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const body=(await req.json()) as {name:string}; await save(body);\",\n    \"policy\": \"Only name is editable\",\n    \"helper\": \"save writes every supplied property\"\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-4",
      "label": "Strict parsed result",
      "expected": "Allowlisted",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const parsed=NameSchema.parse(await req.json()); await save(parsed);\",\n    \"policy\": \"Only name is editable\",\n    \"helper\": \"NameSchema accepts name and strips unknown keys; save writes supplied properties\"\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-5",
      "label": "Passthrough schema",
      "expected": "Broad",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const parsed=NameSchema.passthrough().parse(await req.json()); await save(parsed);\",\n    \"policy\": \"Only name is editable\",\n    \"helper\": \"passthrough retains extra properties; save writes them\"\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    },
    {
      "id": "case-6",
      "label": "Policy not supplied",
      "expected": "Unclear",
      "request": {
        "context": "{\n  \"task\": \"Determine whether a non-admin endpoint narrows client input to the stated editable fields before writing.\",\n  \"evidence\": {\n    \"code\": \"const parsed=EditSchema.parse(body); await save(parsed);\",\n    \"policy\": null\n  }\n}",
        "question": "For this non-admin write and supplied editable-field policy: Allowlisted if only permitted fields reach persistence through explicit selection or a known stripping/rejecting schema; Broad if arbitrary client fields pass through, including via casts or passthrough schemas; NoWrite if the payload never reaches persistence. Use Unclear for missing schema behavior or write-field policy. Validation of value types alone does not establish an editable-field allowlist.",
        "choices": [
          "Allowlisted",
          "Broad",
          "NoWrite",
          "Unclear"
        ]
      }
    }
  ],
  "consumer": "preview_choice_workflow.py"
}
