Skip to content

Cell - Ta Permission Gate ​

A pi package: allows, asks for permission on, or denies tool calls based on rules. No Cell dependency; both Ta and pi can install it:

bash
ta install npm:@celljs/ta-permission-gate
pi install npm:@celljs/ta-permission-gate

Rules are written in permissions.json, with one global file (in the agent directory) and one per project (in .ta/ or .pi/):

json
{
  "default": "allow",
  "rules": [
    { "tool": "bash", "command": "git push*", "action": "ask" },
    { "tool": "bash", "command": "*rm -rf*", "action": "deny" },
    { "path": "*/.env*", "action": "deny" }
  ]
}
  • The first matching rule in each file takes effect. If none match, use default (default is allow); * matches any characters, others are literal.
  • Both files take the stricter result: a project can only tighten permissions, not loosen them; otherwise an untrusted repo could give itself permissions.
  • ask calls ctx.ui.confirm. If no answer arrives within 5 minutes, it's treated as deny. Without a UI (-p) it's directly denied. Under ta serve, the dialog is sent to all connected clients.
  • If a file cannot be read or has bad format, all calls are denied.

When there's no permissions.json, nothing is restricted, consistent with pi's default behavior.