AI-Studio/app/MindWork AI Studio/Tools/Web/WebPageRetrievalOptions.cs
Thorsten Sommer 40ac215359
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Allowed reading plain text and JSON from the web, with a stronger prompt injection filter (#1000)
2026-09-23 22:21:09 +02:00

38 lines
1.5 KiB
C#

using AIStudio.Provider;
namespace AIStudio.Tools.Web;
public sealed class WebPageRetrievalOptions
{
public required int TimeoutSeconds { get; init; }
/// <summary>
/// Whether the user named this exact URL, as opposed to a model asking for it.
/// </summary>
/// <remarks>
/// Lifts the restrictions on which targets may be reached — private networks, loopback, and
/// hosts named localhost — because those exist to keep a model from reaching into the user's
/// network, and the user is not a model. The network-level protections stay: the connection
/// is still bound to validated addresses, redirects are still checked, the response size is
/// still capped, and only HTML and text content are still accepted.<br/><br/>
/// Never set this for a URL that reached AI Studio through a model, however plausible it
/// looks.
/// </remarks>
public bool TargetChosenByUser { get; init; }
public bool PublicTargetsOnly { get; init; }
public ConfidenceLevel ProviderConfidence { get; init; } = ConfidenceLevel.NONE;
public bool UseOsSso { get; init; }
public Func<string, bool>? IsPrivateHostAllowed { get; init; }
/// <summary>
/// Decides for every URL, the first one as well as each redirect target, whether it may be
/// requested at all. It runs before anything is sent, so a refused target never sees the URL.
/// </summary>
public Func<Uri, bool>? IsTargetAllowed { get; init; }
public Func<Uri, ConfidenceLevel, Task>? OnPrivateHostProviderBlockAsync { get; init; }
}