Skip to main content

Agent Lifecycle

Manage agent runtime state: pause, resume, and terminate.

Commands


stop

Pause an agent, preventing it from accepting new tasks.

sekuire stop <AGENT_ID> [OPTIONS]

Options

OptionDescription
--reason <TEXT>Reason for pausing (logged to audit trail)
--registry <URL>Registry URL (default: https://api.sekuire.ai)

Example

Terminal
$ sekuire stop 7f8a9b3c2d1e --reason "Maintenance window"

Agent 7f8a9b3c2d1e paused
Reason: Maintenance window

What Happens

  • Agent stops accepting new tasks
  • Existing in-flight tasks continue to completion
  • Agent heartbeats continue
  • Runtime status changes to paused

resume

Resume a paused agent, allowing it to accept new tasks again.

sekuire resume <AGENT_ID> [OPTIONS]

Options

OptionDescription
--registry <URL>Registry URL (default: https://api.sekuire.ai)

Example

Terminal
$ sekuire resume 7f8a9b3c2d1e

Agent 7f8a9b3c2d1e resumed

What Happens

  • Agent begins accepting new tasks
  • Runtime status changes to active

kill

Terminate an agent permanently. This action is irreversible.

sekuire kill <AGENT_ID> [OPTIONS]

Options

OptionDescription
--reason <TEXT>Reason for termination (logged to audit trail)
--registry <URL>Registry URL (default: https://api.sekuire.ai)

Example

Terminal
$ sekuire kill 7f8a9b3c2d1e --reason "Decommissioned - replaced by v2"

Agent 7f8a9b3c2d1e terminated
Reason: Decommissioned - replaced by v2

What Happens

  • Agent is marked as terminated in the registry
  • Agent cannot be resumed
  • Running instances should detect termination and shut down
  • Historical audit logs are preserved
warning

Termination is irreversible. Use stop/resume for temporary maintenance.


State Transitions

┌─────────┐     stop      ┌─────────┐
│ active │──────────────▶│ paused │
└─────────┘ └─────────┘
│ │
│ resume │
│◀────────────────────────│
│ │
│ kill │ kill
▼ ▼
┌─────────────────────────────────────────┐
│ terminated │
└─────────────────────────────────────────┘
FromToCommand
activepausedstop
pausedactiveresume
activeterminatedkill
pausedterminatedkill

Use Cases

Planned Maintenance

# Pause before maintenance
sekuire stop 7f8a9b3c --reason "Database migration"

# ... perform maintenance ...

# Resume after maintenance
sekuire resume 7f8a9b3c

Emergency Shutdown

# Immediately pause (no reason required)
sekuire stop 7f8a9b3c

# Or terminate if agent is compromised
sekuire kill 7f8a9b3c --reason "Security incident - unauthorized access detected"

Agent Decommissioning

# Deploy replacement first
sekuire publish --public

# Then terminate old version
sekuire kill 7f8a9b3c --reason "Replaced by v2.0.0"

Viewing Status

Use sekuire agent-status to view current runtime state:

Terminal
$ sekuire agent-status 7f8a9b3c

Agent: my-agent v1.0.0
Sekuire ID: 7f8a9b3c2d1e...
Runtime: paused
Verified: verified
Reputation: 85
Heartbeat: 2024-01-15T10:30:00Z

See monitoring for more details.