今日已更新 339 条资讯 | 累计 26751 条内容
关于我们

标签:#token

找到 19 篇相关文章

AI 资讯

JWT Validation: Verifying Tokens for Authentication and Authorization

JWT Validation: Verifying Tokens for Authentication and Authorization A practical guide to JWT validation — the process of checking a JSON Web Token's signature, claims, and structure to confirm a request is genuinely authenticated and authorized — covering signature verification, standard claim checks, key rotation, validation in ASP.NET Core, and the mistakes that most commonly lead to broken or bypassed validation. Table of Contents Introduction Anatomy of a JWT Signing Algorithms What "Validation" Actually Checks Signature Verification and Key Rotation Standard Claim Validation Validating JWTs in ASP.NET Core Custom Validation Logic Token Revocation: JWT's Fundamental Limitation Validating JWTs Across Services Common Vulnerabilities Debugging Validation Failures Quick Reference Table Conclusion Introduction A JWT arriving in an Authorization: Bearer <token> header is just a string until it's actually validated — and validation is doing considerably more work than it might first appear. It's not just "does this look like a JWT" or even just "is the signature valid" — proper validation confirms the token was issued by a trusted party, intended for this specific API, still within its valid time window, and hasn't been tampered with in any way. Get any one of these checks wrong or skip it, and you can end up with an API that accepts tokens it absolutely shouldn't. builder . Services . AddAuthentication ( JwtBearerDefaults . AuthenticationScheme ) . AddJwtBearer ( options => { options . Authority = "https://login.microsoftonline.com/{tenant-id}/v2.0" ; options . Audience = "api://my-api" ; }); Those two lines look simple, but they configure a genuinely thorough validation pipeline underneath — this guide covers exactly what that pipeline actually checks, why each check matters, and where things commonly go wrong when validation is configured incorrectly or bypassed under pressure. 1. Anatomy of a JWT Three parts, dot-separated eyJhbGciOiJSUzI 1 NiIsInR 5 cCI 6 IkpXVC

2026-08-01 原文 →
AI 资讯

Gemini 3.6 Flash: 17% fewer tokens, lower cost, and a Python cold start fix you didn't have to ask for

This week's releases cluster around a theme: reducing the overhead that compounds in production agentic systems. Gemini 3.6 Flash ships with measurable token reduction and a price cut, Vercel's AI Gateway gets service tier routing for latency-cost tradeoffs, and Python cold starts quietly drop by half with zero code changes required. Nothing experimental here—most of this is worth touching immediately if you're already in these ecosystems. Gemini 3.6 Flash cuts output tokens by 17% Google's 3.6 Flash reduces output token usage by 17% versus 3.5 Flash while lowering cost to $1.50/1M input and $7.50/1M output. The improvement is most pronounced on coding and web tasks, which happen to be the workload profile of most production agents. The companion model, 3.5 Flash-Lite, trades some quality for throughput—350 output tokens/sec—at $0.30/$2.50 per million tokens. Token efficiency isn't a vanity metric in agentic systems. Multi-step workflows compound output costs: every intermediate reasoning step, tool call response, and context accumulation multiplies what you pay. A 17% reduction per model call can translate to significantly more than 17% savings across a full agent loop, depending on how many hops your workflow runs. The throughput number on Flash-Lite matters too—if you're running high-volume document classification or search reranking, 350 tokens/sec opens architectures that weren't cost-viable before. The API swap is a single parameter change. No migration friction, no new authentication surface. Ship it now if Gemini is already in your stack and you're paying attention to inference costs. Replace 3.5 Flash with 3.6 Flash for general agentic tasks; move high-throughput, lower-stakes subtasks to Flash-Lite. Gemini 3.6 Flash and 3.5 Flash-Lite on AI Gateway Both new Gemini models are immediately available through Vercel's AI Gateway, callable via the unified AI SDK with the same cost tracking, failover, and routing you'd use for any other provider. Model selection

2026-07-23 原文 →
AI 资讯

Why Long Prompts Make AI Worse (And How to Fix Them)

Most people, when a prompt stops working, write more . They add clarifications, repeat instructions in different words, hedge against edge cases they haven't encountered yet. The prompt doubles in length. The output gets worse. This is the opposite of what you should do. A long prompt is not a precise prompt. It is an ambiguous prompt that happens to have a lot of words in it. Every sentence that does not tightly constrain the output is a sentence that dilutes the sentences that do. Why Long Prompts Underperform When a language model processes your prompt, it attends to all tokens simultaneously — but not equally. Attention is probabilistic. Instructions that are buried in filler, repeated in slightly different forms, or surrounded by low-information prose get proportionally less weight. The model's ability to track which constraint takes precedence over which degrades as the signal-to-noise ratio of the prompt drops. In quantitative trading, the signal-to-noise ratio (SNR) is the single most important property of any strategy signal — a strategy that works in backtesting but fails live is almost always a noise problem, not a signal problem. The same principle applies directly to prompts. Every redundant qualifier, every throat-clearing sentence, every hedge phrase is noise riding on top of your actual instruction signal. The model's attention mechanism cannot distinguish intent from filler. It weighs them together, which means your real constraints compete for attention against your own verbal padding. A concrete way to see this: take a 600-word prompt and a 120-word prompt that contains the same core logic. The 120-word version, if well-constructed, will frequently outperform the 600-word one. Not because brevity is a virtue in itself, but because removing the surrounding noise forces the remaining tokens to do all the work — and they accumulate proportionally more attention weight. This is not speculative. It is the same mechanism behind why prompt drift happens

2026-07-17 原文 →
AI 资讯

You Don't Need an LLM to Route Agent Context: Regex Beats Classifiers by 45 Points

LLM agents burn a ridiculous number of tokens on redundancy: opening the same files again and again, trying a patch, failing, then wandering back through the repo like they’ve never seen it before. A July 2026 paper, ContextSniper: AntTrail's Token-Efficient Code Memory for Repository-Level Program Repair , puts real numbers behind that waste. In repository-level repair, agents keep dragging in irrelevant code and logs. ContextSniper tackles that with a context layer built around tiered memory and an intention-aware context gate that filters low-value regions before they ever reach the model. That gate alone cut tokens by 51.5% on one host agent and 38.9% on Claude Code, while submitted-resolution rates stayed basically in the same neighborhood. The gate is the interesting part, because it is not tied to that paper’s exact system. It is a more general idea, and it is starting to show up across agent architectures. At heart, the gate is just a classifier. Given a request, it has to decide what kind of retrieval will answer the question cheapest: symbol lookup, semantic search, graph impact, mutation prep, or something else. That leads to the practical question the paper does not really answer: Do you need another LLM call just to decide what context to retrieve? We tested that directly. Five ways agents get code into context Before you can gate anything, you need a retrieval strategy. Most current systems fall into one of five rough families: Grounded read-only retrieval: parse the code and return exact symbol source by name. Byte-precise, no synthesis. Graph code intelligence: model calls, imports, entities, and dependencies as a graph, then traverse it. Embedding / RAG search: use vector similarity over chunks. Whole-repo packers: compress or dump the repo into the context window. Mutate / execute runtimes: retrieve context, then modify or run code. None of these is magic. Graphs are great for relationships, but they can drift away from source. RAG is useful, but f

2026-07-09 原文 →
AI 资讯

Tokens

Introduction Although we interact with LLMs using natural language, these models never processes raw text directly. Before a prompt reaches the model, it is converted into a sequence of tokens , the fundamental units that the model understands. Tokenization is one of the earliest stages of the inference pipeline and influences everything from context windows and API pricing to latency and memory usage. What Is a Token? A token is the smallest unit of text processed by a language model, it is not necessarily a word. Depending on the tokenizer, a token may represent: an entire word part of a word punctuation whitespace numbers symbols emojis Different models use different tokenizers, so the same text may be split differently depending on the model. Why Tokens? Simply because language models operate on numbers, not text. Before the transformer can perform any computation, the input must be converted into a numerical representation. The preprocessing pipeline looks like this: Raw Text │ ▼ Tokenizer │ ▼ Tokens │ ▼ Token IDs │ ▼ Embedding Layer │ ▼ Embedding Vectors │ ▼ Transformer The tokenizer splits the input into tokens and each token is then mapped to a unique integer called a token ID , which are passed through the model's embedding layer, which converts them into dense vectors that become the actual input to the transformer. A Real Example Instead of using hypothetical examples, let's look at how OpenAI's tokenizer processes text. Input: I have no enemies. OpenAI tokenizes it to: ["I", " have", " no", " enemies", "."] with the following token IDs: [40, 679, 860, 33974, 13] that have been generated by OpenAI Tokenizer for the "GPT-5.x & O1/3" models. The transformer never sees the original sentence, it only receives the corresponding sequence of token IDs. Token IDs After tokenization, every token is replaced with an integer. Conceptually: " have" → 679 " no" → 860 " enemies" → 33974 ... The exact numbers differ between models because each tokenizer has its own voca

2026-07-06 原文 →
AI 资讯

Copilot CLI drops the PAT requirement inside GitHub Actions

GitHub said this week that Copilot CLI, when it runs inside a GitHub Actions workflow, will accept the built-in GITHUB_TOKEN for authentication. Per the July 2 changelog, the previous path required creating and storing a personal access token. The operational read is small and precise: one fewer human-owned credential to mint, rotate and inherit. The exact scope of the change The changelog covers a narrow surface. It applies to Copilot CLI when invoked from a GitHub Actions workflow, and it swaps the required credential from a PAT to the workflow's ambient GITHUB_TOKEN . GitHub does not describe changes to how Copilot CLI authenticates outside Actions, and this post will not extrapolate to those contexts. If your Copilot CLI usage lives on a developer laptop or in another CI system, nothing in this announcement moves for you. Why the PAT was the wrong credential to leave in the loop A personal access token has almost none of the properties you would want from an automation credential. It does not expire on a job boundary. It carries a person's identity, not the workflow's. It sits in Actions secrets long enough to outlive the engineer who created it. And its scopes were chosen by that engineer, at that moment, often wider than the job actually needs. GITHUB_TOKEN is the opposite shape. Actions mints it at the start of a job, scopes it through the workflow's permissions: block, and revokes it when the job ends. If the token leaks, the window for abuse is the runtime of the job, not the years until somebody remembers to rotate it. When the person who wrote the workflow leaves, the pipeline does not silently break because a token expired with their account. For scripted Copilot CLI calls that had to be wrapped in a PAT, that is the whole win. The tool authenticates against the workflow instead of against a human. Wiring it up The workflow-side pattern is the same one every GITHUB_TOKEN -consuming step already follows: declare permissions: explicitly at the job level, k

2026-07-04 原文 →
AI 资讯

Dependabot can finally pull from private GitHub Packages without a PAT

The first time I wired Dependabot up to a private package registry, it took three meetings and a calendar reminder set six months ahead. The reminder was for the personal access token I had to mint to do it, the one I would have to rotate by hand before it expired, living in a config that drifted somewhere between repo settings, a .github file, and an internal wiki page nobody had touched in a year. On June 23 GitHub posted a small changelog item that quietly retires that whole ritual: Dependabot can now read your private GitHub Packages and GHCR registries through its own GITHUB_TOKEN , no PAT required. If you have ever had to explain to a security review why your bot account holds a token your team owns but a person minted, you already know why this lands. The PAT we all had and nobody loved Until this week, Dependabot's path to a private GitHub-hosted package was the same path it took years ago. A human minted a personal access token, scoped wide enough to read the registry, stored it as a repo or org secret, and plugged it into Dependabot so the bot could authenticate when it tried to resolve dependencies. That token expired on a human schedule. It belonged to whoever happened to set Dependabot up, which is rarely the person who still owns the repo a year later. You can feel how that ends. Tokens that quietly expire and break a Dependabot PR the day someone needs the patch. Tokens that follow an offboarded engineer out the door. Tokens with scopes wider than the job actually requires, because nobody wanted to mint a fine-grained one per registry path. None of those failures are catastrophic on their own. All of them are the kind of papercut a platform team ends up owning. What the GITHUB_TOKEN does here The new behavior is straightforward. Dependabot's job-scoped GITHUB_TOKEN can now request a packages: read permission. When the bot pulls from a hostname under *.pkg.github.com or ghcr.io , it sends that token instead of asking for a PAT. The same token that alre

2026-06-24 原文 →
AI 资讯

Tokenomics Foundation (introducción y perspectiva)

FinOps X 2026 , terminó hace apenas una semana y concluyó con JR Storment, el Director Ejecutivo de la FinOps Foundation compartiendo uno de los anuncios más esperados, la presentación de Tokenomics Foundation . ¿Qué es? Es una iniciativa de la Linux Foundation, que busca establecer estándares abiertos, lineamientos referentes, y buenas prácticas de forma específica para el costo en Inteligencia Artificial y el uso de tokens, así como otros elementos relacionados con esta tecnología con el objetivo de guiar a las empresas y organizaciones a optimizar su consumo de IA y generar mejores resultados en el valor tecnológico. Algunas acciones: Visualización de los costos Atribución del valor Estandarización de procesos, entre ellos FOCUS La creación de esta iniciativa surge en un momento en el que la IA, se ha colocado como una de las tendencias más relevantes, desde LATAM y otras regiones, con diferentes niveles de desarrollo, y un nivel de diversidad complejo. De forma aparente el costo de la IA puede verse reflejado en los tokens, pero la realidad es que sólo es una parte de los que representa el costo de soluciones de IA, partiendo particularmente de la estructura de costos de estas tecnología, en lo global, podemos detectar 3: Costos del modelo : Engloban los costos del desarrollo e implementación del modelo Costos indirectos : Están relacionados con el funcionamiento de un modelo a nivel organizacional Costos asociados : Integran las erogaciones, relacionadas con las puesta en marcha del modelo, pero no directamente en él, por ejemplo, la infraestructura, y servicios relacionados Dentro de cada categoría de costos, los servicios y etapas del desarrollo de IA, son variados Los servicios y etapas de la creación de procesos de IA que están involucrados en cada categoría de costos, muestran la complejidad para la creación de valor en estas iniciativas. Durante FinOps X, tuvimos diferentes charlas relacionadas con IA, el principal reto: cómo monitorear, medir, e incremen

2026-06-21 原文 →
AI 资讯

General Token Economics: The Core System Behind a Sustainable Web3 Project

Token economics is not only about token price. It is about designing the rules, incentives, and long-term logic of a Web3 ecosystem. When people start building a Web3 project, they usually focus on the visible parts first. They think about the smart contract, the frontend, the wallet connection, the token launch, the whitepaper, and maybe the community. All of those are important. But there is one part that can decide whether the project survives or fails: Token economics. A project can have clean smart contracts, a nice UI, and strong marketing, but if the token economy is weak, the project can slowly collapse. Users may come only for rewards, early investors may dump, inflation may destroy value, and the token may lose its reason to exist. That is why token economics should not be treated as just a “crypto finance” topic. For developers and Web3 builders, token economics is closer to system design . It defines how value moves inside the ecosystem, how users are rewarded, how supply is controlled, how governance works, and how the project can grow without depending only on hype. What Is Token Economics? Token economics, often called tokenomics , means the design of how a token works inside a project. It answers questions like: Why does this token exist? Who receives the token? How is the token used? How many tokens will exist? How are rewards distributed? When can team and investor tokens unlock? How does the project treasury work? What creates real demand for the token? In simple words, token economics is the rule system behind a token. A token is not only something people buy and sell. In a real Web3 product, a token can be used for payments, staking, governance, access, rewards, collateral, or network fees. If the token has no clear role, it becomes only a speculative asset. That is dangerous because speculation can bring attention, but it cannot support a project forever. Why Developers Should Care Some developers think token economics is only for founders, eco

2026-06-14 原文 →
AI 资讯

Why Decentralized AI Compute Needs Two Assets, Not One

Bittensor pays roughly eight dollars in TAO token emissions for every dollar of real AI revenue that flows through the network. The exact ratio fluctuates by quarter, but the shape is durable. Q1 2026: about $328 million in annual emissions against $43 million in real AI revenue. That is 7.6 to 1. It is what the crypto-skeptical press has called "extractive by default." It is also what the crypto-friendly analysts call "the subsidy treadmill." The Bittensor engineering team is sophisticated. The subnet validators run real ML evaluation. The miners serve real inference. The revenue is real. The emissions are also real. The cause is the token model itself. One asset is asked to do two jobs that do not belong together. I want to be specific about this part, because every other decentralized AI compute network I have looked at has the same problem, and the fix is well-known. What the token does A token in a decentralized AI compute network does two structurally distinct things. The first job is utility settlement . Contributors run inference, and someone has to pay them for the compute work they did. The payment medium has to scale with usage, has to be denominated in something the contributor can spend on the network or convert to fiat, and has to remain stable enough that contributors can plan around it. This is a billing system. The second job is value capture . Early supporters, investors, and contributors take risk to bootstrap a network that does not yet exist. They have to be paid back for that risk in a way that scales with the eventual success of the network. The payment medium has to be a speculative asset that appreciates as the network grows. This is an equity instrument. A billing system and an equity instrument want opposite things. A billing system that is also a speculative asset means that contributors who get paid in it cannot help but hold a speculative position. An equity instrument that is also a billing system means that token-price volatility show

2026-06-05 原文 →
AI 资讯

On-Chain Dividends Are Silent. Your Tax Bill Isn't.

Someone asked us a sharp question on X this week. Tokenized stocks will drop dividends straight on-chain, so do we see any downsides? It's a fair question, and the honest answer is yes, one big one. The downside isn't the dividend itself. Instant, programmatic, no broker statement to wait for: that part is genuinely good. The downside is that you can't see it. On-chain dividends for tokenized equities are silent. They arrive without a transaction, without a notification, without anything landing in your wallet history. And a payment you never see is a payment you never declare. That's not a tracking annoyance. It's a tax problem, and it gets expensive. The dividend that never sent a transaction Backed Finance's xStocks (the Xs-prefixed mints like AAPLx, TSLAx, NVDAx) and Ondo Global Markets equities (the ondo-suffixed mints) both use the SPL Token-2022 ScaledUiAmount extension. It's an elegant piece of engineering. When the underlying stock pays a dividend, the issuer doesn't airdrop tokens to thousands of wallets. It updates a single number, a multiplier, on the mint account itself. The instant that multiplier changes, every wallet holding the token shows a larger balance. Your 10 shares are now worth the equivalent of 10 shares plus the reinvested dividend. No transfer hit your wallet. No transaction was signed. Nothing appeared in your activity feed. The number simply went up. Compare that with a traditional brokerage. When Apple pays a dividend, you get a line on a statement, an email, a figure on a 1099 or an annual tax summary. The paperwork chases you. On-chain, nothing chases you. The dividend is real, it's yours, and the only evidence it happened is a multiplier value buried in an on-chain mint account that almost nobody thinks to read. Why a number going up is a taxable event Here's the part that catches people. Dividend income is ordinary income. It's taxable in the year you receive it, at your marginal rate, in every jurisdiction we serve: Australia, the

2026-05-29 原文 →