How To

Configuration

Configure Sink gateway port, authentication, logging, and core parameters

Configuration

Overview

The Sink gateway is the main interface between users and the platform. Through gateway configuration, you can control:

  • The port and address the service listens on
  • Logging level and frontend feature toggles
  • Optional AI capability settings

This guide covers common gateway configuration tasks.

Configuration File Location

The gateway configuration file is located at:

~/.sink/gateway.json

Here ~/.sink corresponds to SINK_HOME/.sink, with a default value of ~/.sink.

Quick Start: Basic Configuration

Scenario 1: Change the Service Port

# Edit ~/.sink/gateway.json
{
  "port": 8080,
  "host": "127.0.0.1"
}

The change takes effect after restarting the gateway. Access the Web UI at http://127.0.0.1:8080.

Scenario 2: Allow Remote Access

{
  "port": 5000,
  "host": "0.0.0.0"
}

This allows other machines to access via http://<your-ip>:5000.

Scenario 3: Configure Port Using Environment Variables

Use environment variable interpolation syntax in gateway.json:

{
  "port": "${PORT:-5000}",
  "host": "127.0.0.1"
}

This means: use the PORT environment variable, or default to 5000 if not set.

On startup:

PORT=8080 sink gateway start

Authentication Configuration

Static Bearer Token (Additional Authentication)

In addition to the primary authentication method, you can configure additional Bearer tokens:

{
  "authTokens": [
    "token-1",
    "token-2"
  ]
}

Use them in the Authorization header when sending requests:

curl -H "Authorization: Bearer token-1" http://localhost:5000/api/config

This is useful for integration scripts or CI/CD pipelines.

Logging Configuration

Log Level

{
  "logLevel": "info"
}

Possible values:

  • fatal - Only fatal errors
  • error - Errors only
  • warn - Warnings and above
  • info - General information (default)
  • debug - Detailed debug information
  • trace - All logs (most verbose)
  • silent - Disable all log output

Viewing Logs

Logs are printed to standard output. When running the gateway, you can:

# View logs directly
sink gateway start

# Or redirect to a file
sink gateway start > sink.log 2>&1

Frontend Feature Toggles

Control which feature menus are visible in the Web UI through uiConfig:

{
  "uiConfig": {
    "showProfiles": true,
    "showRuntimes": true,
    "showSkills": true,
    "showMcp": true,
    "showInstructions": true,
    "showVscode": true,
    "showCanvas": true,
    "simpleMode": false
  }
}

Available Feature Toggles

Use Case

Scenario: Present different UI to different users

You can dynamically control feature toggles using environment variables:

{
  "uiConfig": {
    "showProfiles": "${SHOW_PROFILES:-true}",
    "showVscode": "${SHOW_VSCODE:-false}",
    "simpleMode": "${SIMPLE_MODE:-false}"
  }
}

On startup:

# Hide VS Code menu and enable simple mode
SHOW_VSCODE=false SIMPLE_MODE=true sink gateway start

Settings Configuration

In addition to gateway.json, Sink has a global settings.json configuration that supports three layers.

Location: ~/.sink/settings.json and <workspace>/.sink/settings.json

Common Configuration Items

{
  "env": {
    "ANTHROPIC_API_KEY": "sk-...",
    "CUSTOM_VAR": "value"
  },
  "logLevel": "info",
  "agentLifecycle": {
    "maxConcurrent": 4,
    "idleSwapOutMs": 300000
  },
  "sandbox": {
    "enabled": true
  }
}
FieldDescription
envEnvironment variable injection (injected into Agent processes)
logLevelWorkspace-level logging level
agentLifecycle.maxConcurrentMaximum number of concurrently running Agents
agentLifecycle.idleSwapOutMsTime in milliseconds before idle Agents can be suspended
sandbox.enabledWhether to enable sandbox isolation

Troubleshooting

Gateway Startup Failure

Check for JSON syntax errors in the configuration file:

cat ~/.sink/gateway.json | jq .

If there’s an error, fix the JSON format and retry.

Environment Variable Interpolation Not Working

Check:

  1. If the environment variable is actually set: echo $VAR_NAME
  2. If the configuration file is being read correctly: startup logs should show configuration loading information
  3. If the interpolation syntax in gateway.json is correct

Authentication Issues

  • 403 Unauthorized: Check if the Bearer token is correct (if authTokens is configured)

Performance Issues

  • Increase agentLifecycle.maxConcurrent to allow more Agents to run in parallel
  • Increase agentLifecycle.idleSwapOutMs to reduce Agent suspension frequency
  • Adjust logLevel to warn or error to reduce logging I/O

Next Steps