pub struct PromptConfig {
pub max_issue_body_bytes: usize,
pub max_diff_bytes: usize,
pub max_commit_message_bytes: usize,
}Expand description
Per-field byte limits for user-supplied content before prompt assembly. These limits defend against prompt injection by enforcing a hard cap on how much user-controlled data can reach the AI model.
Fields§
§max_issue_body_bytes: usizeMaximum bytes for an issue body (default: 32 KiB).
Limits the size of user-supplied issue body text before it is wrapped in XML tags and sent to the AI model. Larger limits allow more context but increase token usage and prompt injection surface area. The default (32 KiB) balances context richness against cost and security.
max_diff_bytes: usizeMaximum bytes for a PR diff (default: 128 KiB).
Limits the total size of all file patches in a PR before they are wrapped in XML tags and sent to the AI model. The default (128 KiB) accommodates typical multi-file changes while keeping token usage reasonable and reducing prompt injection risk.
max_commit_message_bytes: usizeMaximum bytes for a commit message (default: 4 KiB).
Limits the size of commit message text before wrapping. The default (4 KiB) is conservative, as commit messages are typically short; this prevents abuse via artificially large commit messages.
Trait Implementations§
Source§impl Clone for PromptConfig
impl Clone for PromptConfig
Source§fn clone(&self) -> PromptConfig
fn clone(&self) -> PromptConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more