# Keeping Keys Private

## Private information and PCI Compliance

You can prevent critical information from being saved to records by adding a `deletePaths` array of data model paths you want to remove or `'***'` out from the data model.

* All hooks will have full access the original payload data, but the sensitive data is never committed to any record in any FileMaker file.
* If you are saving the data model you will also have to apply a `deletePaths` function.
* This features takes advantage of the JSON.deletePaths custom function.

## Example

```yaml
// Supplied
{
  "model": {
    "deletePaths": [
    "payment.cvv",
    "payment.exp",
    "payment.cardNumber"
    ],
    "nameFirst": "Charles ",
    "nameLast": "Delfs",
    "payment": {
      "address1": "50 moore",
      "cardNumber": "1231 11221 212121",
      "city": "Bradford on",
      "country": "canada",
      "cvv": "123",
      "exp": "11-11"
    }
  }
}

// Results is saved data:
{
  "model": {
    "deletePaths": [
      "payment.cvv",
      "payment.exp",
      "payment.cardNumber"
    ],
    "nameFirst": "Charles ",
    "nameLast": "Delfs",
    "payment": {
      "address1": "50 moore",
      "cardNumber": "***",
      "city": "Bradford on",
      "country": "canada",
      "cvv": "***",
      "exp": "***"
    }
  }
}
```

### Example Cleaning Function

Use this from within a hook to access the $$model or $model var (new or old hooks)

```
$modelCleaned = 
Let(
[

deletePaths = JSONGetElement ( $model; "deletePaths" )
];

If ( not IsEmpty ( deletePaths ) 
  ; JSON.DeletePaths ( $model ; deletePaths ; "***" ) 
  ;$model 
  )

)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/v1/reference/hooksoverview/payloadobject.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
