Skip to content

Conversation

@migmartri
Copy link
Member

@migmartri migmartri commented Nov 7, 2025

Summary

Add organization-level setting to control whether workflows and projects can be created implicitly during attestation init. This helps prevent workflow and contract sprawl in automated environments.

When prevent_implicit_workflow_creation is enabled, workflows must be created explicitly via chainloop workflow create.

$ go run main.go org update --name testing-123  --prevent-implicit-workflow-creation=true
$ go run main.go att init --workflow sast --project my-project-2222 --release  --replace
ERR creating workflows during the attestation process is disabled for this organization. Please create them in advance or contact your administrator

Changes

  • Add prevent_implicit_workflow_creation field to organization
  • Add validation in workflow creation to check organization setting
  • Add CLI flag --prevent-implicit-workflow-creation to organization update command

Fixes #2526

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri requested review from javirln and jiparis and removed request for jiparis November 7, 2025 17:20
@migmartri migmartri marked this pull request as draft November 7, 2025 17:20
}

if org.PreventImplicitWorkflowCreation {
return nil, NewErrValidation(errors.New("implicit workflow and project creation is disabled for this organization. Please create the workflow explicitly using 'chainloop workflow create'"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review this error code.

@migmartri migmartri requested a review from jiparis November 7, 2025 22:38
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri marked this pull request as ready for review November 7, 2025 23:24
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri changed the title Add organization setting to prevent implicit workflow creation feat: add setting to prevent implicit workflow creation Nov 10, 2025
@migmartri migmartri requested a review from Piskoo November 10, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

option to limit the creation of workflows

1 participant