Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update agent.go

Daniel Hougaard074446df1f19
diff --git a/cli/packages/cmd/agent.go b/cli/packages/cmd/agent.go
index b14fd04e2a..4459416748 100644
--- a/cli/packages/cmd/agent.go
+++ b/cli/packages/cmd/agent.go
@@ -884,6 +884,12 @@ func (tm *AgentManager) MonitorSecretChanges(secretTemplate Template, templateId
if err != nil {
log.Error().Msgf("unable to process template because %v", err)
+
+ // case: if exit-after-auth is true, it should exit the agent once an error on secret fetching occurs with the appropriate exit code (1)
+ // previous behavior would exit after 25 sec with status code 0, even if this step errors
+ if tm.exitAfterAuth {
+ os.Exit(1)
+ }
} else {
if (existingEtag != currentEtag) || firstRun {