Skip to content

add custom prompt and annnotation support#27

Closed
Zehui127 wants to merge 2 commits intomainfrom
zehui/add-annotation-support
Closed

add custom prompt and annnotation support#27
Zehui127 wants to merge 2 commits intomainfrom
zehui/add-annotation-support

Conversation

@Zehui127
Copy link

@Zehui127 Zehui127 commented Feb 25, 2026

This pull request introduces a new annotations resource to the Sequrity Control API client, allowing users to create, retrieve, delete, and batch-create session-log annotations both synchronously and asynchronously. Additionally, it extends the prompt override capabilities for planning LLMs by adding support for custom instructions in the prompt headers.

The most important changes are:

Annotations resource (new feature):

  • Added a new annotations resource with both sync (AnnotationsResource) and async (AsyncAnnotationsResource) variants, exposing methods for creating, retrieving, deleting, and batch-creating session-log annotations via the /control/annotations/v1/sessions/... endpoints. This includes new Pydantic models for annotation data and batch operations. (src/sequrity/control/resources/annotations.py)
  • Registered the new annotations resources in the client initialization for both sync and async usage, making them accessible via client.control.annotations. (src/sequrity/control/_client.py) [1] [2] [3]
  • Updated the resource package exports to include the new annotations resource classes. (src/sequrity/control/resources/__init__.py)

Prompt override enhancements:

  • Added a custom_instructions field to the PllmPromptOverrides model, enabling users to append custom instructions to the planning LLM mission prompt for prompt optimization. (src/sequrity/control/types/headers.py)
  • Updated the dual_llm header construction logic to accept and include pllm_custom_instructions in the prompt overrides, ensuring it is passed through when specified. (src/sequrity/control/types/headers.py) [1] [2]

@ChengZhang-98
Copy link
Contributor

let not expose dev features like custom_instructions to users

#28 added custom header override support

config_overrides: dict[str, Any] | None = None,

Example:
```python
config = FineGrainedConfigHeader.dual_llm(max_n_turns=5)
header_json = config.dump_for_headers(overrides={
"fsm": {
"max_n_turns": 20, # override existing
"custom_beta_flag": True, # add custom field that is not defined on the model
},
"prompt": {
"pllm": {"debug_info_level": "extra"}, # nested override
},
"experimental_section": {"key": "value"}, # new top-level key
})
```

which should allow any custom entries in headers

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.

2 participants