Skip to content


The data policy defines the data you want to change, and the transformations or redactions you want to apply.

Cape Python requires data policies in YAML format. This example describes all the available YAML objects:

# Required. The policy name.
label: test_policy
# Required. The Cape Privacy specification version. Must be 1.
version: 1
# Configure your named transformations.
# Named transformations allow you to reuse a transformation
# with a set value throughout your policy.
    # This named transformation uses the built-in tokenizer transformation
    - name: my_tokenizer
      type: tokenizer
      max_token_len: 10
      key: "my secret"
    # Required. The column name.
    - match: 
        name: fruit
        # This example shows a named transformation.
        # It tells the policy runner to apply the my_tokenizer transformation
        # to all fields in the "fruit" column.
        - transform:
            name: my_tokenizer
    - match: 
        name: weight
        - transform:
            # This example shows an unnamed transformation.
            # It tells the policy runner to:
            # (1) Apply the transformation numeric-rounding 
            # (2) Round to one decimal place
            type: numeric-rounding
            dtype: Double
            precision: 1