You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perry supports bearer token authentication to secure API access. When enabled, all API requests must include a valid authentication token.
4
+
5
+
## Overview
6
+
7
+
By default, Perry runs without authentication. This is convenient for local development but not recommended when the agent is accessible over a network. Enable authentication to:
8
+
9
+
- Prevent unauthorized access to workspace management
10
+
- Secure remote access via Tailscale or other networks
11
+
- Protect sensitive credentials stored in workspaces
12
+
13
+
## Generating a Token
14
+
15
+
### Using the CLI
16
+
17
+
During initial setup or reconfiguration:
18
+
19
+
```bash
20
+
perry setup
21
+
```
22
+
23
+
Follow the prompts to generate an authentication token. The token will be displayed once and stored securely.
24
+
25
+
Alternatively, generate a token directly:
26
+
27
+
```bash
28
+
perry auth generate
29
+
```
30
+
31
+
### Using the Web UI
32
+
33
+
1. Open the Perry web interface
34
+
2. Navigate to **Settings > Security**
35
+
3. Click **Generate Token** (or **Regenerate Token** if one exists)
36
+
4. Copy the displayed token immediately - it won't be shown again
37
+
38
+
## Configuring Clients
39
+
40
+
### CLI Configuration
41
+
42
+
When running `perry setup` against a remote agent with authentication enabled, you'll be prompted to enter the token:
43
+
44
+
```bash
45
+
perry setup --agent http://remote-host:6660
46
+
# Enter token when prompted
47
+
```
48
+
49
+
The token is stored in `~/.config/perry/config.json`.
50
+
51
+
### Web UI
52
+
53
+
When accessing the web UI of an agent with authentication enabled, you'll be prompted to enter the token. The token is stored in your browser's local storage.
54
+
55
+
### API Requests
56
+
57
+
Include the token in the `Authorization` header:
58
+
59
+
```bash
60
+
curl -H "Authorization: Bearer <your-token>" \
61
+
http://localhost:6660/rpc/workspaces.list
62
+
```
63
+
64
+
## Disabling Authentication
65
+
66
+
### Using the CLI
67
+
68
+
```bash
69
+
perry auth disable
70
+
```
71
+
72
+
### Using the Web UI
73
+
74
+
1. Navigate to **Settings > Security**
75
+
2. Click **Disable Authentication**
76
+
3. Confirm the action in the dialog
77
+
78
+
:::warning
79
+
Disabling authentication allows anyone with network access to control your Perry agent. Only disable authentication on trusted networks or for local-only access.
80
+
:::
81
+
82
+
## Regenerating Tokens
83
+
84
+
If you suspect a token has been compromised, regenerate it immediately:
85
+
86
+
1. Generate a new token (CLI or Web UI)
87
+
2. Update all clients with the new token
88
+
3. The old token is automatically invalidated
89
+
90
+
## Security Considerations
91
+
92
+
### Network Exposure
93
+
94
+
-**Local only**: Authentication is optional but recommended
95
+
-**Tailscale/VPN**: Enable authentication to protect against compromised tailnet members
96
+
-**Public internet**: Always enable authentication and consider additional security measures
97
+
98
+
### Token Storage
99
+
100
+
- CLI: Stored in `~/.config/perry/config.json` with file permissions `600`
101
+
- Web UI: Stored in browser local storage
102
+
- Agent: Stored in the agent's configuration file
103
+
104
+
### Best Practices
105
+
106
+
1. Generate unique tokens for each deployment
107
+
2. Regenerate tokens periodically
108
+
3. Use environment variables for automation instead of hardcoding tokens
0 commit comments