Approval System
How to configure and use CodeSpar's cross-channel approval system — quorum rules, token-based approvals, self-approval blocking, and audit logging.
Approval System
CodeSpar's approval system ensures that high-risk actions (like production deployments) require explicit human authorization before execution. Approvals work across channels — you can approve from WhatsApp what was requested in Slack.
How It Works
When an agent needs approval for an action, it follows this flow:
Approval Tokens
Every pending action gets a unique token with a prefix indicating the action type:
| Prefix | Action Type | Example |
|---|---|---|
dp- | Deploy | dp-abc123 |
rv- | Review approval | rv-def456 |
tk- | Task execution | tk-ghi789 |
cf- | Config change | cf-jkl012 |
Tokens are short (8-12 characters) to make them easy to type in chat. They are unique across the entire system and expire after a configurable timeout.
Default Quorum
The quorum is the minimum number of approvals needed before an action executes:
| Environment | Default Quorum | Meaning |
|---|---|---|
| Staging | 1 | One team member must approve |
| Production | 2 | Two team members must approve |
These defaults can be changed in the Dashboard Settings under the Policies tab.
Approval Flow: Step by Step
1. Request an Action
A team member requests a deployment:
2. Agent Sends Approval Request
The agent broadcasts an approval request to all configured channels:
This message appears in all connected channels (Slack, Discord, WhatsApp, Telegram), so any team member can respond regardless of which platform they use.
3. First Approval
A team member approves from any channel:
The agent updates the status:
4. Second Approval (Quorum Met)
Another team member approves:
The agent confirms quorum and executes the action:
5. Action Executes
The deploy proceeds automatically, and the agent reports the result:
Cross-Channel Approval
One of CodeSpar's key features is that approvals work across messaging platforms. A deploy requested in Slack can be approved from WhatsApp, Discord, or Telegram.
How It Works
| Step | Channel | Actor |
|---|---|---|
| Request | Slack | Sarah Chen requests deploy |
| Approve | Discord | Marcus Lee approves |
| Approve | Ana Costa approves | |
| Execute | System | Deploy Agent runs the deploy |
The approval token (dp-abc123) is the same across all channels. The agent tracks which channel each vote came from and includes this information in the audit trail.
Identity Resolution
When a team member approves from a different channel than the requester, the agent resolves their identity using the cross-channel identity mapping. See the Multi-Channel Guide for how to set up identity linking.
Self-Approval Blocking
By default, the person who requested an action cannot approve their own request. This enforces separation of duties:
Disabling Self-Approval Blocking
If your team is small and self-approval blocking is impractical, you can disable it in the Dashboard Settings under the Policies tab:
When disabled, any team member (including the requester) can approve.
Rejection
Any team member can reject a pending action:
Rejection is immediate — it cancels the action regardless of how many approvals have been collected:
Rejection with Reason
You can include a reason when rejecting:
The reason is included in the notification and audit trail.
Expiration
Approval tokens expire after a configurable timeout. The default is 1 hour for standard actions and 15 minutes for critical actions.
When a token expires:
Configuring Expiration
Expiration timeouts can be adjusted via environment variables:
| Variable | Default | Description |
|---|---|---|
APPROVAL_TIMEOUT_DEFAULT | 3600 (1 hour) | Timeout for standard actions (seconds) |
APPROVAL_TIMEOUT_CRITICAL | 900 (15 min) | Timeout for critical actions (seconds) |
Audit Logging
Every approval event is recorded in the immutable audit trail:
| Event | Logged Data |
|---|---|
| Request created | Token, action type, requester, channel, timestamp |
| Vote cast | Token, voter, vote (approve/reject), channel, timestamp |
| Quorum met | Token, all voters, channels, final timestamp |
| Action executed | Token, result (success/failure), duration |
| Token expired | Token, votes at expiration, timestamp |
| Rejection | Token, rejector, reason, channel, timestamp |
Each event includes the actor's identity, the channel it originated from, and a hash chain reference for tamper evidence. See the Audit Trail documentation for details.
Configuration Summary
| Setting | Location | Default |
|---|---|---|
| Staging quorum | Dashboard Settings > Policies | 1 |
| Production quorum | Dashboard Settings > Policies | 2 |
| Self-approval blocking | Dashboard Settings > Policies | On |
| Standard timeout | APPROVAL_TIMEOUT_DEFAULT env var | 1 hour |
| Critical timeout | APPROVAL_TIMEOUT_CRITICAL env var | 15 minutes |
Safety Guardrails
Regardless of autonomy level (even L5 Full Auto), certain actions always require approval:
- Production deployments
- Data migrations
- Security-sensitive changes
- Infrastructure modifications
These guardrails cannot be disabled. They exist to protect against accidental or malicious actions.
Next Steps
- Deploy Pipeline — orchestrate deployments with the Deploy Agent
- Multi-Channel Setup — enable cross-channel approvals
- Dashboard Audit Trail — review approval history
- Security — RBAC and security configuration