# Filter the response of an action with output

> Declare output so only the listed fields leave the action, for example to never leak a password hash.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 3cc2aaaa9e55db35473103cb96c6ca1e8480d56cdbfdbf6345ba475fae365801
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

`output` has the same syntax as `input`, but it is applied to the **response**: only the declared fields are sent, converted to their types. Declare it on every action that reads from a database and you cannot leak a field by accident.

```js definitions/users.js
NEWACTION('Users/read', {
	name: 'Read a user',
	output: 'id:String, name:String, age:Number',
	action: function($) {
		$.callback({ id: '1', name: 'Peter', age: '42', password: 'secret-hash', token: 'abc' });
	}
});
```

```js controllers/users.js
exports.install = function() {
	ROUTE('GET /user/ --> *Users/read');
};
```
