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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PromptConfig
impl Debug for PromptConfig
Source§impl Default for PromptConfig
impl Default for PromptConfig
Source§impl<'de> Deserialize<'de> for PromptConfigwhere
PromptConfig: Default,
impl<'de> Deserialize<'de> for PromptConfigwhere
PromptConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PromptConfig
impl RefUnwindSafe for PromptConfig
impl Send for PromptConfig
impl Sync for PromptConfig
impl Unpin for PromptConfig
impl UnsafeUnpin for PromptConfig
impl UnwindSafe for PromptConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more