Skip to content

feat(sdk): add step_type as input parameter to the control decorator and evaluate_controls function - #262

Merged
namrataghadi-galileo merged 4 commits into
mainfrom
feature/SAO-17170-support-step-type-in-control-decorator
Sep 18, 2026
Merged

namrataghadi-galileo merged 4 commits into
mainfrom
feature/SAO-17170-support-step-type-in-control-decorator

Conversation

@namrataghadi-galileo

Copy link
Copy Markdown
Contributor

Summary

  • Added support for arbitrary custom step types such as retriever, trace, and session across the Python SDK, telemetry, observability models, TypeScript SDK, and UI API types.
    Existing llm/tool inference remains unchanged.
    This is to accomodate controls at different levels especially Luna but not restricted to Galileo levels only.

Scope

User-facing/API changes:- Added step_type: str | None to @agent_control.control().

  • Widened evaluate_controls(step_type) to accept custom strings.
  • Updated generated TypeScript/UI API artifacts.

Internal changes:- Preserved custom decorator arguments and telemetry classifications.

  • Added step-type normalization and validation.
  • Added endpoint and regression tests.

Out of scope:- Google ADK and Strands adapters remain intentionally limited to LLM/tool lifecycle events.

Risk and Rollout

Risk level: low
Rollback plan: Revert this commit.

Testing

  • [ x] Added or updated automated tests
  • [ x] Ran make check (or explained why not)
  • [x ] Manually verified behavior

Checklist

  • Linked issue/spec (if applicable)
  • [ x] Updated docs/examples for user-facing changes
  • Included any required follow-up tasks

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@josjeon josjeon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Question:

So my understanding is that an unknown type/typo like step_type="sesion" passes through and matches no controls, and process() early returns is_safe=True, confidence=1.0 like:

if not applicable:
confidence = 0.0 if precheck_errors else 1.0
return EvaluationResponse(
is_safe=True,
confidence=confidence,
matches=None,
errors=precheck_errors or None,
)

so it reads the same as a genuine pass. Assuming that's intentional for now?

@namrataghadi-galileo

Copy link
Copy Markdown
Contributor Author

@josjeon Yes—that is intentional with the current generic string-based design.
step_type="sesion" is accepted as a non-empty custom type. If no controls apply to that type, the engine returns:

  • is_safe=True
  • confidence=1.0 when there are no precheck errors
  • no matches
    This preserves support for arbitrary custom step types, but means typos can silently bypass controls scoped to "session". Controls without a step-type restriction may still apply. A future strict mode or registered step-type vocabulary could detect typos, but that is not part of this change.

Comment thread sdks/python/src/agent_control/validation.py
Comment thread sdks/python/src/agent_control/evaluation_events.py Outdated
Comment thread sdks/python/src/agent_control/integrations/google_adk/plugin.py
Comment thread sdks/python/src/agent_control/integrations/strands/plugin.py
@josjeon
josjeon self-requested a review September 18, 2026 14:44
@namrataghadi-galileo
namrataghadi-galileo enabled auto-merge (squash) September 18, 2026 15:51
@namrataghadi-galileo
namrataghadi-galileo merged commit 9d12df0 into main Sep 18, 2026
6 checks passed
@namrataghadi-galileo
namrataghadi-galileo deleted the feature/SAO-17170-support-step-type-in-control-decorator branch September 18, 2026 15:56
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.

3 participants