This Commented CUE demonstrates how to disallow specific data fields inside an otherwise open schema.

package example

// This schema is open because we do not know
// which additional fields might be present.
name!:    string
address!: string

// We must not allow our data model to contain
// people's ages, so we disallow the age field.
age?: _|_
name: Charlie Cartwright
address: Ripon, North Yorkshire
species: cat
age: 15.5
$ cue vet . data.yaml
explicit error (_|_ literal) in source:

Another common way to prevent the existence of unwanted data fields is to rely on the closedness property that comes from the use of definitions or the close built-in function. However, in situations such as the example above, closedness cannot be used to disallow specific fields because the schema author cannot specify each and every acceptable field - and therefore the schema must be left open.